From: Denis Charmet Date: Wed, 11 Aug 2010 07:58:40 +0000 (+0200) Subject: Fix lua telnet vlm_message_to_string X-Git-Tag: 1.2.0-pre1~5463 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=1b67e3a69eb1fa93947d0b8f44fdd64e7899ff5f 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 --- diff --git a/modules/misc/lua/libs/vlm.c b/modules/misc/lua/libs/vlm.c index 32f448e024..d48755c176 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 67cc0cc0f1..8de12ff3ea 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