[vlc-devel] commit: Also dump item name, uri, duration and es info. (Antoine Cellerier )
git version control
git at videolan.org
Sat Feb 13 19:23:21 CET 2010
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Feb 13 18:57:36 2010 +0100| [d19961463a9b840d455bf6481b2b87279eb7cbb3] | committer: Antoine Cellerier
Also dump item name, uri, duration and es info.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d19961463a9b840d455bf6481b2b87279eb7cbb3
---
share/lua/intf/dumpmeta.lua | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/share/lua/intf/dumpmeta.lua b/share/lua/intf/dumpmeta.lua
index 7876111..3b3af56 100644
--- a/share/lua/intf/dumpmeta.lua
+++ b/share/lua/intf/dumpmeta.lua
@@ -22,7 +22,9 @@
--]==========================================================================]
--[[ to dump meta data information in the debug output, run:
- vlc -I lua --lua-intf dumpmeta -v=0 coolmusic.mp3
+ vlc -I lua --lua-intf dumpmeta coolmusic.mp3
+ Additional options can improve performance and output readability:
+ -V dummy -A dummy --no-video-title --no-media-library --verbose-objects +lua,-all -v=0
--]]
local item
@@ -30,11 +32,29 @@ repeat
item = vlc.input.item()
until (item and item:is_preparsed()) or vlc.misc.should_die()
+-- preparsing doesn't always provide all the information we want (like duration)
+repeat
+until item:stats()["demux_read_bytes"] > 0 or vlc.misc.should_die()
+
+vlc.msg.info("name: "..item:name())
+vlc.msg.info("uri: "..vlc.strings.decode_uri(item:uri()))
+vlc.msg.info("duration: "..tostring(item:duration()))
+
+vlc.msg.info("meta data:")
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)
+ vlc.msg.info(" "..key..": "..value)
+ end
+else
+ vlc.msg.info(" no meta data available")
+end
+
+vlc.msg.info("info:")
+for cat, data in pairs(item:info()) do
+ vlc.msg.info(" "..cat)
+ for key, value in pairs(data) do
+ vlc.msg.info(" "..key..": "..value)
end
end
More information about the vlc-devel
mailing list