]> git.sesse.net Git - vlc/commitdiff
Add new rate command to rc.
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 27 Dec 2009 21:14:10 +0000 (22:14 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 27 Dec 2009 21:14:10 +0000 (22:14 +0100)
Enables setting playback rate to a specific value.

share/lua/intf/rc.lua

index 21a104012a53300ad2c6d9e2537033e273703b81..1a105662de5da294e3db31ea7ee5548debb6478f 100644 (file)
@@ -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" } };