提交 24e7a22e 编写于 作者: H Hendrik Leppkes 提交者: Michael Niedermayer

riff: don't overwrite bps from WAVEFORMATEX if EXTENSIBLE doesn't contain that data.

According to the specification on the MSDN [1], 0 is valid for that particular field, and it should be ignored in that case.

[1]: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757714(v=vs.85).aspxSigned-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 cb08b6ef
......@@ -596,7 +596,9 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
cbSize = FFMIN(size, cbSize);
if (cbSize >= 22 && id == 0xfffe) { /* WAVEFORMATEXTENSIBLE */
ff_asf_guid subformat;
codec->bits_per_coded_sample = avio_rl16(pb);
int bps = avio_rl16(pb);
if (bps)
codec->bits_per_coded_sample = bps;
codec->channel_layout = avio_rl32(pb); /* dwChannelMask */
ff_get_guid(pb, &subformat);
if (!memcmp(subformat + 4, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册