]> git.sesse.net Git - vlc/commitdiff
* modules/codec/theora.c: bug fix with aspect ratio.
authorGildas Bazin <gbazin@videolan.org>
Sun, 7 Dec 2003 18:15:46 +0000 (18:15 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 7 Dec 2003 18:15:46 +0000 (18:15 +0000)
modules/codec/theora.c

index b51cc95e6752abbb364da3bbc8f1a1f8ec2625ec..9f8f8250a7b8f2b85f114a2a6f17dc18c08716e9 100644 (file)
@@ -2,7 +2,7 @@
  * theora.c: theora decoder module making use of libtheora.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: theora.c,v 1.17 2003/12/07 17:53:45 gbazin Exp $
+ * $Id: theora.c,v 1.18 2003/12/07 18:15:46 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -475,8 +475,18 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_sys->ti.offset_y = frame_y_offset;
     p_sys->ti.fps_numerator = video_hzn;
     p_sys->ti.fps_denominator = video_hzd;
-    p_sys->ti.aspect_numerator = p_enc->fmt_in.video.i_aspect;
-    p_sys->ti.aspect_denominator = VOUT_ASPECT_FACTOR;
+
+    if( p_enc->fmt_in.video.i_aspect )
+    {
+        p_sys->ti.aspect_numerator = p_enc->fmt_in.video.i_aspect;
+        p_sys->ti.aspect_denominator = VOUT_ASPECT_FACTOR;
+    }
+    else
+    {
+        p_sys->ti.aspect_numerator = 4;
+        p_sys->ti.aspect_denominator = 3;
+    }
+
     p_sys->ti.target_bitrate = p_enc->fmt_out.i_bitrate;
     p_sys->ti.quality = video_q;