Commit 8099fc76 authored by Justin Ruggles's avatar Justin Ruggles

riff: use bps instead of bits_per_coded_sample in the WAVEFORMATEXTENSIBLE header

This matches the value for the plain WAVEFORMATEX header.
Also fixes stream copy to WAVE for non-16-bit raw pcm.
parent b1041f80
...@@ -482,7 +482,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc) ...@@ -482,7 +482,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
if(waveformatextensible) { /* write WAVEFORMATEXTENSIBLE extensions */ if(waveformatextensible) { /* write WAVEFORMATEXTENSIBLE extensions */
hdrsize += 22; hdrsize += 22;
avio_wl16(pb, riff_extradata - riff_extradata_start + 22); /* 22 is WAVEFORMATEXTENSIBLE size */ avio_wl16(pb, riff_extradata - riff_extradata_start + 22); /* 22 is WAVEFORMATEXTENSIBLE size */
avio_wl16(pb, enc->bits_per_coded_sample); /* ValidBitsPerSample || SamplesPerBlock || Reserved */ avio_wl16(pb, bps); /* ValidBitsPerSample || SamplesPerBlock || Reserved */
avio_wl32(pb, enc->channel_layout); /* dwChannelMask */ avio_wl32(pb, enc->channel_layout); /* dwChannelMask */
avio_wl32(pb, enc->codec_tag); /* GUID + next 3 */ avio_wl32(pb, enc->codec_tag); /* GUID + next 3 */
avio_wl32(pb, 0x00100000); avio_wl32(pb, 0x00100000);
......
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