SDL: support for autoscaling
authorJoseph Tulou <brezhoneg1@yahoo.fr>
Fri, 30 Jan 2009 16:30:35 +0000 (17:30 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 2 Feb 2009 02:32:23 +0000 (03:32 +0100)
Modifications by /me
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/video_output/sdl.c

index 187e539..055524d 100644 (file)
@@ -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 )