]> git.sesse.net Git - vlc/commitdiff
lua: always use vlclua_dofile
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 10 Feb 2015 12:56:16 +0000 (13:56 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 10 Feb 2015 12:56:43 +0000 (13:56 +0100)
Ref #13752

modules/lua/demux.c
modules/lua/intf.c
modules/lua/meta.c
modules/lua/services_discovery.c

index eac4f249edce222cf5aa51a9b438b2d3373671cb..13ccf61673429aca2499ec610b4af30117fab495 100644 (file)
@@ -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 ) ) );
index 61943549abcaf4278f8e9a151e688e9a976e4646..841587f2222471414b1069473205c51443a2397e 100644 (file)
@@ -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 ) ) );
index 34c5d87bce95c8c567d0fa04f0173761760062f9..b78fa935a7aa03ce0adfbe1c3900ae4736847e8a 100644 (file)
@@ -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 ) ) );
index 74c8c6c406414bd718c8d8ecd1d4bc4e4afc7a82..62ea9ec1a079c332d87b0f8fc321f2ca40def673 100644 (file)
@@ -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 ) );