]> git.sesse.net Git - vlc/blobdiff - modules/lua/libs/sd.c
lua: fix equalizer setting code
[vlc] / modules / lua / libs / sd.c
index 48a2434341412ce3c81091bb14c4d88ff9a76e75..5bca2572866aaf1feb97a286384547a803f164e9 100644 (file)
@@ -224,8 +224,8 @@ static int vlclua_sd_add_item( lua_State *L )
             int i_options = 0;
             const char *psz_path = lua_tostring( L, -1 );
 
-            vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
             lua_pop( L, 1 );
+            vlclua_read_options( p_sd, L, &i_options, &ppsz_options );
             lua_getfield( L, -1, "title" );
             const char *psz_title = luaL_checkstring( L, -1 ) ? luaL_checkstring( L, -1 ) : psz_path;
             input_item_t *p_input = input_item_NewExt( psz_path, psz_title,
@@ -292,6 +292,13 @@ static int vlclua_sd_remove_item( lua_State *L )
     return 1;
 }
 
+static int vlclua_sd_remove_all_items_nodes( lua_State *L )
+{
+    services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
+    services_discovery_RemoveAll( p_sd );
+    return 1;
+}
+
 static int vlclua_node_add_subitem( lua_State *L )
 {
     services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L );
@@ -417,6 +424,7 @@ static const luaL_Reg vlclua_sd_reg[] = {
     { "add_node", vlclua_sd_add_node },
     { "add_item", vlclua_sd_add_item },
     { "remove_item", vlclua_sd_remove_item },
+    { "remove_all_items_nodes", vlclua_sd_remove_all_items_nodes },
     { NULL, NULL }
 };