]> git.sesse.net Git - vlc/commitdiff
* modules/codec/dmo/dmo.c: if an aspect ratio was specified in the input format then...
authorDennis van Amerongen <trax@videolan.org>
Thu, 29 Jun 2006 20:15:57 +0000 (20:15 +0000)
committerDennis van Amerongen <trax@videolan.org>
Thu, 29 Jun 2006 20:15:57 +0000 (20:15 +0000)
modules/codec/dmo/dmo.c

index c97ff41939eb56aec335eec7fe0c3f0d8672e830..6c2a7607ee62244f089fb5063999c52df4435dc5 100644 (file)
@@ -421,8 +421,17 @@ static int DecOpen( vlc_object_t *p_this )
         p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width;
         p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height;
         p_dec->fmt_out.video.i_bits_per_pixel = i_bpp;
-        p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR *
-            p_dec->fmt_out.video.i_width / p_dec->fmt_out.video.i_height;
+
+        /* If an aspect-ratio was specified in the input format then force it */
+        if( p_dec->fmt_in.video.i_aspect )
+        {
+            p_dec->fmt_out.video.i_aspect = p_dec->fmt_in.video.i_aspect;
+        }
+        else
+        {
+            p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR *
+                p_dec->fmt_out.video.i_width / p_dec->fmt_out.video.i_height;
+        }
 
         p_bih = &p_vih->bmiHeader;
         p_bih->biCompression = i_chroma;