]> git.sesse.net Git - vlc/commitdiff
* src/video_output/vout_pictures.c: use fmt_in.i_visible_width/height and i_sar_num...
authorGildas Bazin <gbazin@videolan.org>
Sun, 23 Oct 2005 09:52:32 +0000 (09:52 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 23 Oct 2005 09:52:32 +0000 (09:52 +0000)
src/video_output/vout_pictures.c

index 433cef68dce192c6ea4af5944c781167f43eb7c6..b95a72d9d39d0b7bdfd5c63f5d38627e51d17416 100644 (file)
@@ -440,29 +440,24 @@ void vout_PlacePicture( vout_thread_t *p_vout,
     }
     else
     {
-        *pi_width = __MIN( i_width, p_vout->render.i_width );
-        *pi_height = __MIN( i_height, p_vout->render.i_height );
+        *pi_width = __MIN( i_width, p_vout->fmt_in.i_visible_width );
+        *pi_height = __MIN( i_height, p_vout->fmt_in.i_visible_height );
     }
 
-    if( VOUT_ASPECT_FACTOR * *pi_width / *pi_height < p_vout->render.i_aspect )
+    if( p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num *
+        *pi_height /
+        (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den) >
+        *pi_width )
     {
-        *pi_width = *pi_height * p_vout->render.i_aspect / VOUT_ASPECT_FACTOR;
+        *pi_height = p_vout->fmt_in.i_visible_height *
+            p_vout->fmt_in.i_sar_den * *pi_width /
+            (p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num);
     }
     else
     {
-        *pi_height = *pi_width * VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
-    }
-
-    if( *pi_width > i_width )
-    {
-        *pi_width = i_width;
-        *pi_height = VOUT_ASPECT_FACTOR * *pi_width / p_vout->render.i_aspect;
-    }
-
-    if( *pi_height > i_height )
-    {
-        *pi_height = i_height;
-        *pi_width = *pi_height * p_vout->render.i_aspect / VOUT_ASPECT_FACTOR;
+        *pi_width = p_vout->fmt_in.i_visible_width *
+            p_vout->fmt_in.i_sar_num * *pi_height /
+            (p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den);
     }
 
     switch( p_vout->i_alignment & VOUT_ALIGN_HMASK )