[vlc-devel] commit: Add new rate command to rc. (Antoine Cellerier )

git version control git at videolan.org
Sun Dec 27 23:19:46 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sun Dec 27 22:14:10 2009 +0100| [abfa2cef80509443b6d9930730079018058e2a80] | committer: Antoine Cellerier 

Add new rate command to rc.

Enables setting playback rate to a specific value.

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

 share/lua/intf/rc.lua |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/share/lua/intf/rc.lua b/share/lua/intf/rc.lua
index 21a1040..1a10566 100644
--- a/share/lua/intf/rc.lua
+++ b/share/lua/intf/rc.lua
@@ -405,9 +405,11 @@ function volume(name,client,value)
     end
 end
 
-function rate(name,client)
+function rate(name,client,value)
     local input = vlc.object.input()
-    if name == "normal" then
+    if name == "rate" then
+        vlc.var.set(input, "rate", tonumber(value))
+    elseif name == "normal" then
         vlc.var.set(input,"rate",1)
     else
         vlc.var.set(input,"rate-"..name,nil)
@@ -494,6 +496,7 @@ commands_ordered = {
     { "faster"; { func = rate; help = "faster playing of stream" } };
     { "slower"; { func = rate; help = "slower playing of stream" } };
     { "normal"; { func = rate; help = "normal playing of stream" } };
+    { "rate"; { func = rate; args = "[playback rate]"; help = "set playback rate to value" } };
     { "frame"; { func = frame; help = "play frame by frame" } };
     { "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };
     { "info"; { func = input_info; help = "information about the current stream" } };




More information about the vlc-devel mailing list