X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmisc%2Flua%2Fluaplaylist.c;h=dd883d6efdbd61242a58c3bd4ff2efc11959627c;hb=6ee1e193fd896ab9a4729fde14f009d9ce629815;hp=6a4710c6eff8431603b309275e25f490da3c3da4;hpb=3305b049e7f587b23359a1c9047fb5763d19c1dc;p=vlc diff --git a/modules/misc/lua/luaplaylist.c b/modules/misc/lua/luaplaylist.c index 6a4710c6ef..dd883d6efd 100644 --- a/modules/misc/lua/luaplaylist.c +++ b/modules/misc/lua/luaplaylist.c @@ -135,14 +135,14 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, demux_t * p_demux = (demux_t *)p_this; p_demux->p_sys->psz_filename = strdup(psz_filename); - + /* Ugly hack to delete previous versions of the probe() and parse() * functions. */ lua_pushnil( p_state ); lua_pushnil( p_state ); lua_setglobal( p_state, "probe" ); lua_setglobal( p_state, "parse" ); - + /* Load and run the script(s) */ if( luaL_dofile( p_state, psz_filename ) ) { @@ -151,9 +151,9 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, lua_pop( p_state, 1 ); return VLC_EGENERIC; } - + lua_getglobal( p_state, "probe" ); - + if( !lua_isfunction( p_state, lua_gettop( p_state ) ) ) { msg_Warn( p_demux, "Error while runing script %s, " @@ -161,7 +161,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, lua_pop( p_state, 1 ); return VLC_EGENERIC; } - + if( lua_pcall( p_state, 0, 1, 0 ) ) { msg_Warn( p_demux, "Error while runing script %s, " @@ -170,7 +170,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, lua_pop( p_state, 1 ); return VLC_EGENERIC; } - + if( lua_gettop( p_state ) ) { int i_ret = VLC_EGENERIC; @@ -181,7 +181,7 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename, i_ret = VLC_SUCCESS; } lua_pop( p_state, 1 ); - + return i_ret; } return VLC_EGENERIC;