Commit 11329370 authored by Carl Eugen Hoyos's avatar 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.
parent 565102dc
...@@ -1909,6 +1909,7 @@ static int matroska_read_header(AVFormatContext *s) ...@@ -1909,6 +1909,7 @@ static int matroska_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->sample_rate = track->audio.out_samplerate; st->codec->sample_rate = track->audio.out_samplerate;
st->codec->channels = track->audio.channels; st->codec->channels = track->audio.channels;
if (!st->codec->bits_per_coded_sample)
st->codec->bits_per_coded_sample = track->audio.bitdepth; st->codec->bits_per_coded_sample = track->audio.bitdepth;
if (st->codec->codec_id != AV_CODEC_ID_AAC) if (st->codec->codec_id != AV_CODEC_ID_AAC)
st->need_parsing = AVSTREAM_PARSE_HEADERS; st->need_parsing = AVSTREAM_PARSE_HEADERS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment