[vlc-commits] lua: always use vlclua_dofile

Jean-Baptiste Kempf git at videolan.org
Tue Feb 10 13:58:57 CET 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Feb 10 13:56:16 2015 +0100| [bf7ad95b7810e25f2c483fefda3e15f6239df648] | committer: Jean-Baptiste Kempf

lua: always use vlclua_dofile

Ref #13752

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bf7ad95b7810e25f2c483fefda3e15f6239df648
---

 modules/lua/demux.c              |    2 +-
 modules/lua/intf.c               |    2 +-
 modules/lua/meta.c               |    2 +-
 modules/lua/services_discovery.c |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/lua/demux.c b/modules/lua/demux.c
index eac4f24..13ccf61 100644
--- a/modules/lua/demux.c
+++ b/modules/lua/demux.c
@@ -163,7 +163,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
     }
 
     /* Load and run the script(s) */
-    if( luaL_dofile( L, psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_demux), L, psz_filename ) )
     {
         msg_Warn( p_demux, "Error loading script %s: %s", psz_filename,
                   lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index 6194354..841587f 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -402,7 +402,7 @@ static void *Run( void *data )
     intf_sys_t *p_sys = p_intf->p_sys;
     lua_State *L = p_sys->L;
 
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_intf), L, p_sys->psz_filename ) )
     {
         msg_Err( p_intf, "Error loading script %s: %s", p_sys->psz_filename,
                  lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/meta.c b/modules/lua/meta.c
index 34c5d87..b78fa93 100644
--- a/modules/lua/meta.c
+++ b/modules/lua/meta.c
@@ -89,7 +89,7 @@ static int run( vlc_object_t *p_this, const char * psz_filename,
     lua_setglobal( L, luafunction );
 
     /* Load and run the script(s) */
-    if( luaL_dofile( L, psz_filename ) )
+    if( vlclua_dofile( p_this, L, psz_filename ) )
     {
         msg_Warn( p_this, "Error loading script %s: %s", psz_filename,
                  lua_tostring( L, lua_gettop( L ) ) );
diff --git a/modules/lua/services_discovery.c b/modules/lua/services_discovery.c
index 74c8c6c..62ea9ec 100644
--- a/modules/lua/services_discovery.c
+++ b/modules/lua/services_discovery.c
@@ -124,7 +124,7 @@ int Open_LuaSD( vlc_object_t *p_this )
                   p_sys->psz_filename );
         goto error;
     }
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_sd), L, p_sys->psz_filename ) )
     {
         msg_Err( p_sd, "Error loading script %s: %s", p_sys->psz_filename,
                   lua_tostring( L, lua_gettop( L ) ) );
@@ -317,7 +317,7 @@ static int FillDescriptor( services_discovery_t *p_sd,
     /* Create a new lua thread */
     lua_State *L = luaL_newstate();
 
-    if( luaL_dofile( L, p_sys->psz_filename ) )
+    if( vlclua_dofile( VLC_OBJECT(p_sd), L, p_sys->psz_filename ) )
     {
         msg_Err( p_sd, "Error loading script %s: %s", p_sys->psz_filename,
                  lua_tostring( L, -1 ) );



More information about the vlc-commits mailing list