[FFmpeg-cvslog] lavf/matroskadec: Get sample size from private data

Mats Peterson git at videolan.org
Sat Jan 16 14:19:04 CET 2016


ffmpeg | branch: master | Mats Peterson <matsp888 at yahoo.com> | Fri Jan 15 23:25:38 2016 +0100| [535d09a51099d3c796d6c0c3ec381ff99d5ce0c8] | committer: Michael Niedermayer

lavf/matroskadec: Get sample size from private data

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

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

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

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cc5ec19..d788232 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1891,18 +1891,24 @@ static int matroska_parse_tracks(AVFormatContext *s)
                    /* Normally 36, but allow noncompliant private data */
                    && (track->codec_priv.size >= 32)
                    && (track->codec_priv.data)) {
+            uint16_t sample_size;
             int ret = get_qt_codec(track, &fourcc, &codec_id);
             if (ret < 0)
                 return ret;
+            sample_size = AV_RB16(track->codec_priv.data + 26);
             if (fourcc == 0) {
-                if (track->audio.bitdepth == 8) {
+                if (sample_size == 8) {
                     fourcc = MKTAG('r','a','w',' ');
                     codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
-                } else if (track->audio.bitdepth == 16) {
+                } else if (sample_size == 16) {
                     fourcc = MKTAG('t','w','o','s');
                     codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
                 }
             }
+            if ((fourcc == MKTAG('t','w','o','s') ||
+                    fourcc == MKTAG('s','o','w','t')) &&
+                    sample_size == 8)
+                codec_id = AV_CODEC_ID_PCM_S8;
         } 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