riff: use bps instead of bits_per_coded_sample in the WAVEFORMATEXTENSIBLE header
authorJustin Ruggles <justin.ruggles@gmail.com>
Mon, 16 Apr 2012 16:14:25 +0000 (12:14 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 17 Apr 2012 04:09:19 +0000 (00:09 -0400)
This matches the value for the plain WAVEFORMATEX header.
Also fixes stream copy to WAVE for non-16-bit raw pcm.

libavformat/riff.c

index 2b6165e..8a91345 100644 (file)
@@ -482,7 +482,7 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
     if(waveformatextensible) {                                    /* write WAVEFORMATEXTENSIBLE extensions */
         hdrsize += 22;
         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->codec_tag);                             /* GUID + next 3 */
         avio_wl32(pb, 0x00100000);