vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun May 14 10:40:44 2017 +0300| [0aa0307436cfba9de890ce14bdaa944ff3a707db] | committer: Rémi Denis-Courmont
lua: sd: remove SD item category Lua has support for sub-item which wholly supersets item category. None of the scripts ever used the category parameter anyway. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0aa0307436cfba9de890ce14bdaa944ff3a707db --- modules/lua/libs/sd.c | 18 ++++-------------- share/lua/README.txt | 3 +-- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c index 455547a9d3..c0dd445c66 100644 --- a/modules/lua/libs/sd.c +++ b/modules/lua/libs/sd.c @@ -329,36 +329,26 @@ static const luaL_Reg vlclua_node_reg[] = { /*** Services discovery instance ***/ -static int vlclua_sd_add_common( services_discovery_t *p_sd, lua_State *L, +static int vlclua_sd_add_common( services_discovery_t *p_sd, input_item_t *p_input ) { - if( p_input == NULL ) - return 1; - - lua_getfield( L, -2, "category" ); - if( lua_isstring( L, -1 ) ) - services_discovery_AddItemCat( p_sd, p_input, luaL_checkstring( L, -1 ) ); - else + if( p_input != NULL ) services_discovery_AddItem( p_sd, p_input ); - lua_pop( L, 1 ); - return 1; } static int vlclua_sd_add_item( lua_State *L ) { services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L ); - input_item_t *p_input = vlclua_sd_create_item( p_sd, L ); - return vlclua_sd_add_common( p_sd, L, p_input ); + return vlclua_sd_add_common( p_sd, vlclua_sd_create_item( p_sd, L ) ); } static int vlclua_sd_add_node( lua_State *L ) { services_discovery_t *p_sd = (services_discovery_t *)vlclua_get_this( L ); - input_item_t *p_input = vlclua_sd_create_node( p_sd, L ); - return vlclua_sd_add_common( p_sd, L, p_input ); + return vlclua_sd_add_common( p_sd, vlclua_sd_create_node( p_sd, L ) ); } static int vlclua_sd_remove_item( lua_State *L ) diff --git a/share/lua/README.txt b/share/lua/README.txt index d726fcf095..fb5fe2759c 100644 --- a/share/lua/README.txt +++ b/share/lua/README.txt @@ -325,8 +325,7 @@ sd.add_node( ... ): Add a node to the service discovery. .arturl: the node's ArtURL (OPTIONAL) .category: the node's category (OPTIONAL) sd.add_item( ... ): Add an item to the service discovery. - The item object has the same members as the one in playlist.add() along with: - .category: the item's category (OPTIONAL) + The item object has the same members as the one in playlist.add(). Returns the input item. sd.remove_item( item ): remove the item. _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
