[FFmpeg-devel] [PATCH]lavf/mov: Read aspect ratio from ares atom for dnxhd

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Sep 19 14:32:54 EEST 2016


Hi!

Attached patch fixes the aspect ratio for the sample from 
ticket #5325 / #2125.

The fate test changes because the fate sample  was written 
by FFmpeg with an incorrect aspect ratio.

Please comment, Carl Eugen
-------------- next part --------------
From 0553b0adfee87401854f0313dbcf386f2fb7ae68 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
Date: Mon, 19 Sep 2016 13:30:06 +0200
Subject: [PATCH] lavf/mov: Read aspect ratio from ares atom for dnxhd.

Fixes ticket #2125.
Fixes ticket #5325.
---
 libavformat/mov.c          |    3 ++-
 tests/ref/fate/dnxhd-mbaff |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6e80b93..ce24e2e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1486,7 +1486,8 @@ static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             if (cid == 0xd4d || cid == 0xd4e)
                 par->width = 1440;
             return 0;
-        } else if (par->codec_tag == MKTAG('A', 'V', 'd', '1') &&
+        } else if ((par->codec_tag == MKTAG('A', 'V', 'd', '1') ||
+                    par->codec_tag == MKTAG('A', 'V', 'd', 'n')) &&
                    atom.size >= 24) {
             int num, den;
             avio_skip(pb, 12);
diff --git a/tests/ref/fate/dnxhd-mbaff b/tests/ref/fate/dnxhd-mbaff
index d694cfe..8e95227 100644
--- a/tests/ref/fate/dnxhd-mbaff
+++ b/tests/ref/fate/dnxhd-mbaff
@@ -2,5 +2,5 @@
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 1440x1080
-#sar 0: 4/3
+#sar 0: 1/1
 0,          0,          0,        1,  6220800, 0xe78198c0
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list