Commit e0eb0da8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Lua: fix existent sd loading

parent 4a647cf1
...@@ -188,7 +188,10 @@ static int vlclua_sd_add_node( lua_State *L ) ...@@ -188,7 +188,10 @@ static int vlclua_sd_add_node( lua_State *L )
} }
lua_pop( L, 1 ); lua_pop( L, 1 );
lua_getfield( L, -1, "category" ); lua_getfield( L, -1, "category" );
services_discovery_AddItem( p_sd, p_input, luaL_checkstring( L, -1 ) ); if( lua_isstring( L, -1 ) )
services_discovery_AddItem( p_sd, p_input, luaL_checkstring( L, -1 ) );
else
services_discovery_AddItem( p_sd, p_input, NULL );
input_item_t **udata = (input_item_t **) input_item_t **udata = (input_item_t **)
lua_newuserdata( L, sizeof( input_item_t * ) ); lua_newuserdata( L, sizeof( input_item_t * ) );
*udata = p_input; *udata = p_input;
...@@ -244,7 +247,10 @@ static int vlclua_sd_add_item( lua_State *L ) ...@@ -244,7 +247,10 @@ static int vlclua_sd_add_item( lua_State *L )
msg_Warn( p_sd, "Item duration should be a number (in seconds)." ); msg_Warn( p_sd, "Item duration should be a number (in seconds)." );
lua_pop( L, 1 ); lua_pop( L, 1 );
lua_getfield( L, -1, "category" ); lua_getfield( L, -1, "category" );
services_discovery_AddItem( p_sd, p_input, luaL_checkstring( L, -1 ) ); if( lua_isstring( L, -1 ) )
services_discovery_AddItem( p_sd, p_input, luaL_checkstring( L, -1 ) );
else
services_discovery_AddItem( p_sd, p_input, NULL );
lua_pop( L, 1 ); lua_pop( L, 1 );
input_item_t **udata = (input_item_t **) input_item_t **udata = (input_item_t **)
lua_newuserdata( L, sizeof( input_item_t * ) ); lua_newuserdata( L, sizeof( input_item_t * ) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment