[vlc-devel] commit: SDL: support for autoscaling (Joseph Tulou )

git version control git at videolan.org
Mon Feb 2 03:50:31 CET 2009


vlc | branch: master | Joseph Tulou <brezhoneg1 at yahoo.fr> | Fri Jan 30 17:30:35 2009 +0100| [3d03caf53872716bc3ff44031b892b6496f955a4] | committer: Jean-Baptiste Kempf 

SDL: support for autoscaling

Modifications by /me
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/sdl.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c
index 187e539..055524d 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -577,6 +577,28 @@ static int Manage( vout_thread_t *p_vout )
         p_vout->i_changes |= VOUT_SIZE_CHANGE;
     }
 
+    /* autoscale toggle */
+    if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+
+        p_vout->b_autoscale = var_GetBool( p_vout, "autoscale" );
+        p_vout->i_zoom = (int) ZOOM_FP_FACTOR;
+
+        p_vout->i_changes |= VOUT_SIZE_CHANGE;
+    }
+
+    /* scaling factor (if no-autoscale) */
+    if( p_vout->i_changes & VOUT_ZOOM_CHANGE )
+    {
+        p_vout->i_changes &= ~VOUT_ZOOM_CHANGE;
+
+        p_vout->b_autoscale = false;
+        p_vout->i_zoom = (int)( ZOOM_FP_FACTOR * var_GetFloat( p_vout, "scale" ) );
+
+        p_vout->i_changes |= VOUT_SIZE_CHANGE;
+    }
+
     /* Crop or Aspect Ratio Changes */
     if( p_vout->i_changes & VOUT_CROP_CHANGE ||
         p_vout->i_changes & VOUT_ASPECT_CHANGE )




More information about the vlc-devel mailing list