]> git.sesse.net Git - vlc/commitdiff
LUA: Aspect Ratio
authorAkash Mehrotra <mehrotra.akash@gmail.com>
Sun, 7 Aug 2011 13:03:50 +0000 (18:33 +0530)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 30 Aug 2011 17:35:11 +0000 (19:35 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
share/lua/http/requests/README.txt
share/lua/intf/modules/httprequests.lua

index bdd005922236f7dca9c323d61c6b22eb69a50169..b9b2ae7903e52fb6119a824dae2630ea3445eef8 100644 (file)
@@ -61,6 +61,10 @@ status.xml or status.json
 > set playback rate. must be > 0
   ?command=rate&val=<newplaybackrate>
 
+> set aspect ratio. Must be one of the following values. Any other value will reset aspect ratio to default
+  ?command=aspectratio&val=<newratio>
+  Valid aspect ratio values: 1:1 , 4:3 , 5:4 , 16:9 , 16:10 , 221:100 , 235:100 , 239:100 
+
 > sort playlist using sort mode <val> and order <id>:
   ?command=pl_sort&id=<id>&val=<val>
   If id=0 then items will be sorted in normal order, if id=1 they will be
index c88b8b46d81ef06f6cb6ee35849046eee722ec08..664ac1fcc90c61536f18c0e3755351e6679d52bb 100644 (file)
@@ -154,6 +154,10 @@ processcommands = function ()
          if vlc.object.input() then
           vlc.var.set(vlc.object.input(),"spu-delay",val)
          end
+       elseif command == "aspectratio" then
+         if vlc.object.vout() then
+          vlc.var.set(vlc.object.vout(),"aspect-ratio",val)
+         end
        end
        
        local input = nil
@@ -360,9 +364,10 @@ local aout = vlc.object.aout()
                s.rate=1
                s.subtitledelay=0
        end
-       
        if vout then
                s.fullscreen=vlc.var.get(vout,"fullscreen")
+               s.aspectratio=vlc.var.get(vout,"aspect-ratio");
+               if s.aspectratio=="" then s.aspectratio = "default" end
        else
                s.fullscreen=0
        end