Commit 1b67e3a6 authored by Denis Charmet's avatar Denis Charmet Committed by 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: default avatarRémi Duraffort <ivoire@videolan.org>
parent 2241aa22
...@@ -100,7 +100,7 @@ static void push_message( lua_State *L, vlm_message_t *message ) ...@@ -100,7 +100,7 @@ static void push_message( lua_State *L, vlm_message_t *message )
} }
lua_setfield( L, -2, "children" ); lua_setfield( L, -2, "children" );
} }
else if ( message->psz_value )
{ {
lua_pushstring( L, message->psz_value ); lua_pushstring( L, message->psz_value );
lua_setfield( L, -2, "value" ); lua_setfield( L, -2, "value" );
......
...@@ -78,16 +78,14 @@ function vlm_message_to_string(client,message,prefix) ...@@ -78,16 +78,14 @@ function vlm_message_to_string(client,message,prefix)
local prefix = prefix or "" local prefix = prefix or ""
if message.value then if message.value then
client:append(prefix .. message.name .. " : " .. message.value) client:append(prefix .. message.name .. " : " .. message.value)
return
else else
client:append(prefix .. message.name) client:append(prefix .. message.name)
end
if message.children then if message.children then
for i,c in ipairs(message.children) do for i,c in ipairs(message.children) do
vlm_message_to_string(client,c,prefix.." ") vlm_message_to_string(client,c,prefix.." ")
end end
end end
return
end
end end
--[[ Configure the host ]] --[[ Configure the host ]]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment