[FFmpeg-cvslog] lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000

Mats Peterson git at videolan.org
Fri Jan 8 14:54:12 CET 2016


ffmpeg | branch: master | Mats Peterson <matsp888 at yahoo.com> | Fri Jan  8 12:55:59 2016 +0100| [6f1466dc527208db70bd608784b9223da8f44b9e] | committer: Michael Niedermayer

lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000

In many older QuickTime files, the audio format, or "fourcc", is
0x00000000. The QuickTime File Format Specification states the following
regarding this situation:

"This format descriptor should not be used, but may be found in some
files. Samples are assumed to be stored in either 'raw ' or 'twos'
format, depending on the sample size field in the sound description."

MPlayer handles this logic by itself, but FFmpeg/FFplay currently does
not.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/matroskadec.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d958296..be4e300 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1869,6 +1869,15 @@ static int matroska_parse_tracks(AVFormatContext *s)
                 fourcc = AV_RL32(track->codec_priv.data);
                 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
             }
+            if (fourcc == 0) {
+                if (track->audio.bitdepth == 8) {
+                    fourcc = MKTAG('r','a','w',' ');
+                    codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+                } else if (track->audio.bitdepth == 16) {
+                    fourcc = MKTAG('t','w','o','s');
+                    codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+                }
+            }
         } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
                    (track->codec_priv.size >= 21)          &&
                    (track->codec_priv.data)) {



More information about the ffmpeg-cvslog mailing list