<html><head></head><body>Nack. This feature is the only sane way to debug SD in a clean runtime environment at the moment. Qt definitely is not.<br><br><div class="gmail_quote">Le 4 mars 2019 12:53:28 GMT+02:00, Romain Vimont <rom1v@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Services discovery media were displayed via the old playlist, which<br>allowed to display their tree.<br><br>The new playlist is not a tree, but a list, so it can't be used to<br>display services discovery trees. This lua API is only used from<br>cli.lua, and we consider it's not worth it to implement this feature for<br>now, so just remove it.<hr> modules/lua/extension.c |  1 -<br> modules/lua/intf.c      |  1 -<br> modules/lua/libs/sd.c   | 57 -----------------------------------------<br> share/lua/intf/cli.lua  | 23 -----------------<br> 4 files changed, 82 deletions(-)<br><br>diff --git a/modules/lua/extension.c b/modules/lua/extension.c<br>index 475bd06767..ba25d432a8 100644<br>--- a/modules/lua/extension.c<br>+++ b/modules/lua/extension.c<br>@@ -840,7 +840,6 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,<br>         luaopen_object( L );<br>         luaopen_osd( L );<br>         luaopen_playlist( L );<br>-        luaopen_sd_intf( L );<br>         luaopen_stream( L );<br>         luaopen_strings( L );<br>         luaopen_variables( L );<br>diff --git a/modules/lua/intf.c b/modules/lua/intf.c<br>index cd906b4591..63c902bf21 100644<br>--- a/modules/lua/intf.c<br>+++ b/modules/lua/intf.c<br>@@ -274,7 +274,6 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )<br>     luaopen_object( L );<br>     luaopen_osd( L );<br>     luaopen_playlist( L );<br>-    luaopen_sd_intf( L );<br>     luaopen_stream( L );<br>     luaopen_strings( L );<br>     luaopen_variables( L );<br>diff --git a/modules/lua/libs/sd.c b/modules/lua/libs/sd.c<br>index a35091154d..d0dc85d6c2 100644<br>--- a/modules/lua/libs/sd.c<br>+++ b/modules/lua/libs/sd.c<br>@@ -398,60 +398,3 @@ void luaopen_sd_sd( lua_State *L )<br>     luaL_register( L, NULL, vlclua_sd_sd_reg );<br>     lua_setfield( L, -2, "sd" );<br> }<br>-<br>-<br>-/*** SD management (for user interfaces) ***/<br>-<br>-static int vlclua_sd_get_services_names( lua_State *L )<br>-{<br>-    playlist_t *p_playlist = vlclua_get_playlist_internal( L );<br>-    char **ppsz_longnames;<br>-    char **ppsz_names = vlc_sd_GetNames( p_playlist, &ppsz_longnames, NULL );<br>-    if( !ppsz_names )<br>-        return 0;<br>-<br>-    char **ppsz_longname = ppsz_longnames;<br>-    char **ppsz_name = ppsz_names;<br>-    lua_settop( L, 0 );<br>-    lua_newtable( L );<br>-    for( ; *ppsz_name; ppsz_name++,ppsz_longname++ )<br>-    {<br>-        lua_pushstring( L, *ppsz_longname );<br>-        lua_setfield( L, -2, *ppsz_name );<br>-        free( *ppsz_name );<br>-        free( *ppsz_longname );<br>-    }<br>-    free( ppsz_names );<br>-    free( ppsz_longnames );<br>-    return 1;<br>-}<br>-<br>-static int vlclua_sd_add( lua_State *L )<br>-{<br>-    const char *psz_sd = luaL_checkstring( L, 1 );<br>-    playlist_t *p_playlist = vlclua_get_playlist_internal( L );<br>-    int i_ret = playlist_ServicesDiscoveryAdd( p_playlist, psz_sd );<br>-    return vlclua_push_ret( L, i_ret );<br>-}<br>-<br>-static int vlclua_sd_remove( lua_State *L )<br>-{<br>-    const char *psz_sd = luaL_checkstring( L, 1 );<br>-    playlist_t *p_playlist = vlclua_get_playlist_internal( L );<br>-    int i_ret = playlist_ServicesDiscoveryRemove( p_playlist, psz_sd );<br>-    return vlclua_push_ret( L, i_ret );<br>-}<br>-<br>-static const luaL_Reg vlclua_sd_intf_reg[] = {<br>-    { "get_services_names", vlclua_sd_get_services_names },<br>-    { "add", vlclua_sd_add },<br>-    { "remove", vlclua_sd_remove },<br>-    { NULL, NULL }<br>-};<br>-<br>-void luaopen_sd_intf( lua_State *L )<br>-{<br>-    lua_newtable( L );<br>-    luaL_register( L, NULL, vlclua_sd_intf_reg );<br>-    lua_setfield( L, -2, "sd" );<br>-}<br>diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua<br>index 58501d10d5..02c6967abb 100644<br>--- a/share/lua/intf/cli.lua<br>+++ b/share/lua/intf/cli.lua<br>@@ -250,26 +250,6 @@ function playlist_sort(name,client,arg)<br>     end<br> end<br> <br>-function sd_add(name,client,arg)<br>-    vlc.sd.add(arg)<br>-    client:append(arg.." enabled.")<br>-end<br>-<br>-function sd_remove(name,client,arg)<br>-    vlc.sd.remove(arg)<br>-    client:append(arg.." disabled.")<br>-end<br>-<br>-function services_discovery(name,client,arg)<br>-    local sd = vlc.sd.get_services_names()<br>-    client:append("+----[ Services discovery ]")<br>-    for n,ln in pairs(sd) do<br>-        client:append("| "..n..": " .. ln)<br>-    end<br>-    client:append("+----[ End of services discovery ]")<br>-    client:append("Enabled services discovery sources appear in the playlist.")<br>-end<br>-<br> function load_vlm(name, client, value)<br>     if vlm == nil then<br>         vlm = vlc.vlm()<br>@@ -585,9 +565,6 @@ commands_ordered = {<br>     { "delete"; { func = skip2(vlc.playlist.delete); args = "[X]"; help = "delete item X in playlist" } };<br>     { "move"; { func = move; args = "[X][Y]"; help = "move item X in playlist after Y" } };<br>     { "sort"; { func = playlist_sort; args = "key"; help = "sort the playlist" } };<br>-    { "sd"; { func = services_discovery; args = "[sd]"; help = "show services discovery or toggle" } };<br>-    { "sd_add"; { func = sd_add; args = "sd"; help = "add services discovery" } };<br>-    { "sd_remove"; { func = sd_remove; args = "sd"; help = "remove services discovery" } };<br>     { "play"; { func = skip2(vlc.playlist.play); help = "play stream" } };<br>     { "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } };<br>     { "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } };</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>