[vlc-commits] commit: Fix lua telnet vlm_message_to_string (Denis Charmet )

git at videolan.org git at videolan.org
Wed Aug 11 21:02:19 CEST 2010


vlc/vlc-1.1 | branch: master | Denis Charmet <typx at dinauz.org> | Wed Aug 11 09:58:40 2010 +0200| [246a53cdef8f3bd32e93b165806089ae86dfbfa5] | 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 <ivoire at videolan.org>
(cherry picked from commit 1b67e3a69eb1fa93947d0b8f44fdd64e7899ff5f)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=246a53cdef8f3bd32e93b165806089ae86dfbfa5
---

 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
 



More information about the vlc-commits mailing list