Module: libav
Branch: release/11
Commit: 8286ae42e2a98a13bb2a4c6d2ec8754156680f1e

Author:    Luca Barbato <[email protected]>
Committer: Sean McGovern <[email protected]>
Date:      Sat Mar 12 13:46:13 2016 +0100

matroska: Support V_QUICKTIME as written in the specification

Check if the size is written the first 4 bytes and read the next 4
as fourcc candidate, fallback checking the initial for 4 bytes.

"The CodecPrivate contains all additional data that is stored in the
'stsd' (sample description) atom in the QuickTime file after the
mandatory video descriptor structure (starting with the size and FourCC
fields)"

CC: [email protected]
(cherry picked from commit 8b4b1c1eea9daa4e2003aa0935e73f56aab8102d)

Conflicts:

        libavformat/matroskadec.c

Signed-off-by: Sean McGovern <[email protected]>

---

 libavformat/matroskadec.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 5583f85..f073de7 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1605,9 +1605,16 @@ static int matroska_parse_tracks(AVFormatContext *s)
         } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
                    (track->codec_priv.size >= 86)          &&
                    (track->codec_priv.data)) {
-            track->video.fourcc = AV_RL32(track->codec_priv.data);
-            codec_id            = ff_codec_get_id(ff_codec_movvideo_tags,
-                                                  track->video.fourcc);
+            if (track->codec_priv.size == AV_RB32(track->codec_priv.data)) {
+                track->video.fourcc = AV_RL32(track->codec_priv.data + 4);
+                codec_id            = ff_codec_get_id(ff_codec_movvideo_tags,
+                                                      track->video.fourcc);
+            }
+            if (codec_id == AV_CODEC_ID_NONE) {
+                track->video.fourcc = AV_RL32(track->codec_priv.data);
+                codec_id            = ff_codec_get_id(ff_codec_movvideo_tags,
+                                                      track->video.fourcc);
+            }
         } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
             switch (track->audio.bitdepth) {
             case  8:

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to