[FFmpeg-cvslog] r10361 - trunk/libavformat/matroskaenc.c

conrad subversion
Wed Sep 5 02:25:08 CEST 2007


Author: conrad
Date: Wed Sep  5 02:25:07 2007
New Revision: 10361

Log:
Calculate and store DAR rather than SAR


Modified:
   trunk/libavformat/matroskaenc.c

Modified: trunk/libavformat/matroskaenc.c
==============================================================================
--- trunk/libavformat/matroskaenc.c	(original)
+++ trunk/libavformat/matroskaenc.c	Wed Sep  5 02:25:07 2007
@@ -552,8 +552,9 @@ static int mkv_write_tracks(AVFormatCont
                 put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELWIDTH , codec->width);
                 put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELHEIGHT, codec->height);
                 if (codec->sample_aspect_ratio.num) {
-                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , codec->sample_aspect_ratio.num);
-                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, codec->sample_aspect_ratio.den);
+                    AVRational dar = av_mul_q(codec->sample_aspect_ratio, (AVRational){codec->width, codec->height});
+                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , dar.num);
+                    put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, dar.den);
                 }
                 end_ebml_master(pb, subinfo);
                 break;




More information about the ffmpeg-cvslog mailing list