]> git.sesse.net Git - vlc/commitdiff
Fix lua telnet vlm_message_to_string
authorDenis Charmet <typx@dinauz.org>
Wed, 11 Aug 2010 07:58:40 +0000 (09:58 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Wed, 11 Aug 2010 18:48:26 +0000 (20:48 +0200)
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 <ivoire@videolan.org>
modules/misc/lua/libs/vlm.c
share/lua/intf/telnet.lua

index 32f448e024fec9daf2abc836c1ca3380b340173d..d48755c1769fd6e644d536e4f5d20b5bd9cb2acd 100644 (file)
@@ -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" );
index 67cc0cc0f1295caaaeac0eaba67dd7dd634b7423..8de12ff3eaa5f5168a38679a0e17852e2e119d2d 100644 (file)
@@ -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