# HG changeset patch # User conrad # Date 1188951907 0 # Node ID cdd7d0f4d93cfe463255d7a4746459bc1c5ac6ec # Parent 51d707a515f2123fa026fc2e55274f4f0ee2753d Calculate and store DAR rather than SAR diff -r 51d707a515f2 -r cdd7d0f4d93c matroskaenc.c --- a/matroskaenc.c Wed Sep 05 00:25:04 2007 +0000 +++ b/matroskaenc.c Wed Sep 05 00:25:07 2007 +0000 @@ -552,8 +552,9 @@ 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;