[vlc-devel] commit: Make sure that the playlist item has been preparsed first (and don' t get stuck in an infinite loop). Note that libs/input. c is a mess and would need to be cleanup before we release 1.1. ( Antoine Cellerier )

git version control git at videolan.org
Sat Feb 13 18:26:06 CET 2010


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Feb 13 18:27:05 2010 +0100| [61642608126855b643de8456d8677d9b3a9a5c2f] | committer: Antoine Cellerier 

Make sure that the playlist item has been preparsed first (and don't get stuck in an infinite loop). Note that libs/input.c is a mess and would need to be cleanup before we release 1.1.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=61642608126855b643de8456d8677d9b3a9a5c2f
---

 modules/misc/lua/libs/input.c |    7 +++++++
 share/lua/intf/dumpmeta.lua   |   10 ++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/modules/misc/lua/libs/input.c b/modules/misc/lua/libs/input.c
index 3010caf..1b7bd1e 100644
--- a/modules/misc/lua/libs/input.c
+++ b/modules/misc/lua/libs/input.c
@@ -311,6 +311,12 @@ static int vlclua_input_item_metas( lua_State *L )
     return 1;
 }
 
+static int vlclua_input_item_is_preparsed( lua_State *L )
+{
+    lua_pushboolean( L, input_item_IsPreparsed( vlclua_input_item_get_internal( L ) ) );
+    return 1;
+}
+
 static int vlclua_input_item_set_meta( lua_State *L )
 {
     input_item_t *p_item = vlclua_input_item_get_internal( L );
@@ -381,6 +387,7 @@ void luaopen_input( lua_State *L )
 }
 
 static const luaL_Reg vlclua_input_item_reg[] = {
+    { "is_preparsed", vlclua_input_item_is_preparsed },
     { "metas", vlclua_input_item_metas },
     { "set_meta", vlclua_input_item_set_meta },
     { NULL, NULL }
diff --git a/share/lua/intf/dumpmeta.lua b/share/lua/intf/dumpmeta.lua
index 194d446..7876111 100644
--- a/share/lua/intf/dumpmeta.lua
+++ b/share/lua/intf/dumpmeta.lua
@@ -22,18 +22,20 @@
 --]==========================================================================]
 
 --[[ to dump meta data information in the debug output, run:
-       vlc -I lua --lua-intf dumpmeta coolmusic.mp3
+       vlc -I lua --lua-intf dumpmeta -v=0 coolmusic.mp3
 --]]
 
-local meta
+local item
 repeat
-    meta = vlc.input.metas()
-until meta
+    item = vlc.input.item()
+until (item and item:is_preparsed()) or vlc.misc.should_die()
 
+local meta = item:metas()
 vlc.msg.info("Dumping meta data")
 if meta then
     for key, value in pairs(meta) do
         vlc.msg.info(key..": "..value)
     end
 end
+
 vlc.misc.quit()




More information about the vlc-devel mailing list