[FFmpeg-cvslog] Do not read mkv audio bit_depth if bits_per_coded_sample is already set.

Carl Eugen Hoyos git at videolan.org
Thu Jan 16 00:29:53 CET 2014


ffmpeg | branch: release/2.1 | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Jan 15 23:37:47 2014 +0100| [2f4b781e4db5742bd85abfa1cc9e40af8c27b76b] | committer: Carl Eugen Hoyos

Do not read mkv audio bit_depth if bits_per_coded_sample is already set.

This allows decoding broken mkv files containing G.726 audio.
(cherry picked from commit 11329370770e5c982deece7d4eb4f2e95e725332)

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

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

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cafc96e..c5a6dde 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1906,6 +1906,7 @@ static int matroska_read_header(AVFormatContext *s)
             st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
             st->codec->sample_rate = track->audio.out_samplerate;
             st->codec->channels = track->audio.channels;
+            if (!st->codec->bits_per_coded_sample)
             st->codec->bits_per_coded_sample = track->audio.bitdepth;
             if (st->codec->codec_id != AV_CODEC_ID_AAC)
             st->need_parsing = AVSTREAM_PARSE_HEADERS;



More information about the ffmpeg-cvslog mailing list