[FFmpeg-cvslog] lavf/mov: Set display aspect ratio for avid dv.

Carl Eugen Hoyos git at videolan.org
Wed Mar 2 02:09:54 CET 2016


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Mar  2 02:03:46 2016 +0100| [2355b7458e637a56a8eb878ee9dbe1e06dfd69b2] | committer: Carl Eugen Hoyos

lavf/mov: Set display aspect ratio for avid dv.

Fixes ticket #5271.

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

 libavformat/mov.c     |   19 +++++++++++++++++++
 libavformat/version.h |    2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 043f4a9..2eddc49 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1461,6 +1461,25 @@ static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             if (avio_rb16(pb) == 0xd4d)
                 codec->width = 1440;
             return 0;
+        } else if (codec->codec_tag == MKTAG('A', 'V', 'd', '1') &&
+                   atom.size >= 24) {
+            int num, den;
+            avio_skip(pb, 12);
+            num = avio_rb32(pb);
+            den = avio_rb32(pb);
+            if (num <= 0 || den <= 0)
+                return 0;
+            switch (avio_rb32(pb)) {
+            case 2:
+                if (den >= INT_MAX / 2)
+                    return 0;
+                den *= 2;
+            case 1:
+                c->fc->streams[c->fc->nb_streams-1]->display_aspect_ratio.num = num;
+                c->fc->streams[c->fc->nb_streams-1]->display_aspect_ratio.den = den;
+            default:
+                return 0;
+            }
         }
     }
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 29aca66..4849171 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
 #define LIBAVFORMAT_VERSION_MINOR  27
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list