[vlc-devel] commit: Fix rc intf. (Antoine Cellerier )

git version control git at videolan.org
Sat Feb 13 21:05:37 CET 2010


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Feb 13 21:07:05 2010 +0100| [f0e61014e0ddece9ae982ae9e760aea53281d636] | committer: Antoine Cellerier 

Fix rc intf.

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

 share/lua/intf/rc.lua |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/share/lua/intf/rc.lua b/share/lua/intf/rc.lua
index fdd5ba9..9a66ab0 100644
--- a/share/lua/intf/rc.lua
+++ b/share/lua/intf/rc.lua
@@ -366,6 +366,15 @@ function is_playing(name,client)
     if vlc.input.is_playing() then client:append "1" else client:append "0" end
 end
 
+function get_title(name,client)
+    local item = vlc.input.item()
+    if item then
+        client:append(item:name())
+    else
+        client:append("")
+    end
+end
+
 function ret_print(foo,start,stop)
     local start = start or ""
     local stop = stop or ""
@@ -508,7 +517,7 @@ commands_ordered = {
     { "stats"; { func = stats; help = "show statistical information" } };
     { "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } };
     { "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };
-    { "get_title"; { func = ret_print(vlc.item():name()); help = "the title of the current stream" } };
+    { "get_title"; { func = get_title; help = "the title of the current stream" } };
     { "get_length"; { func = get_time("length"); help = "the length of the current stream" } };
     { "" };
     { "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } };




More information about the vlc-devel mailing list