vlc | branch: master | Denis Charmet <[email protected]> | Wed Aug 11 09:58:40 2010 +0200| [1b67e3a69eb1fa93947d0b8f44fdd64e7899ff5f] | committer: Rémi Duraffort
Fix lua telnet vlm_message_to_string In the current lua vlm implementation, messages can have value xor children but not both. But the "show media" command gives media a value : ( %d broadcast - %d vod ) and children (if any). (cf src/input/vlmshell.c:1502) Signed-off-by: Rémi Duraffort <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1b67e3a69eb1fa93947d0b8f44fdd64e7899ff5f --- modules/misc/lua/libs/vlm.c | 2 +- share/lua/intf/telnet.lua | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/misc/lua/libs/vlm.c b/modules/misc/lua/libs/vlm.c index 32f448e..d48755c 100644 --- a/modules/misc/lua/libs/vlm.c +++ b/modules/misc/lua/libs/vlm.c @@ -100,7 +100,7 @@ static void push_message( lua_State *L, vlm_message_t *message ) } lua_setfield( L, -2, "children" ); } - else + if ( message->psz_value ) { lua_pushstring( L, message->psz_value ); lua_setfield( L, -2, "value" ); diff --git a/share/lua/intf/telnet.lua b/share/lua/intf/telnet.lua index 67cc0cc..8de12ff 100644 --- a/share/lua/intf/telnet.lua +++ b/share/lua/intf/telnet.lua @@ -78,15 +78,13 @@ function vlm_message_to_string(client,message,prefix) local prefix = prefix or "" if message.value then client:append(prefix .. message.name .. " : " .. message.value) - return else client:append(prefix .. message.name) - if message.children then - for i,c in ipairs(message.children) do - vlm_message_to_string(client,c,prefix.." ") - end + end + if message.children then + for i,c in ipairs(message.children) do + vlm_message_to_string(client,c,prefix.." ") end - return end end _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
