[FFmpeg-cvslog] lavf/matroskaenc: use integers to for display size.

Nicolas George git at videolan.org
Wed Dec 12 21:07:18 CET 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Dec  8 11:50:54 2012 +0100| [26db6535fce2022b1b9743e3e964801887557cc5] | committer: Nicolas George

lavf/matroskaenc: use integers to for display size.

Avoid rounding differences between x86_32 and x86_64.
Fix trac ticket #1997.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26db6535fce2022b1b9743e3e964801887557cc5
---

 libavformat/matroskaenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 2a8a2ea..adca74f 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -637,7 +637,7 @@ static int mkv_write_tracks(AVFormatContext *s)
                 }
 
                 if (st->sample_aspect_ratio.num) {
-                    int d_width = codec->width*av_q2d(st->sample_aspect_ratio);
+                    int d_width = av_rescale(codec->width, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
                     put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width);
                     put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, codec->height);
                 }



More information about the ffmpeg-cvslog mailing list