On 10/13/2011 10:09 AM, John Brooks wrote:
> 
> On Thu, Oct 13, 2011 at 1:59 AM, Benjamin Larsson <[email protected]> 
> wrote:
>>
>> There is code to generate the WAVEFORMATEXTENSIBLE header. Reuse instead
>> of adding this.
>>
> 
> WAVEFORMATEXTENSIBLE is another addition on top of WAVEFORMATEX for an
> unrelated purpose. The issue here is WAVEFORMAT and WAVEFORMATEX,
> which differ only by the cbSize field on the end. ff_put_wav_header
> generates WAVEFORMAT (without that field) when possible, but these
> formats|decoders always want WAVEFORMATEX.
> 
> - John

Ok, I missread, anyway the ff_put_wav_header() function has a comment at
the top which says /* WAVEFORMATEX header */. So if the code doesn't
generate a WAVEFORMATEX header when there is no extradata then either
the documentation needs to be changed or the code fixed.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd390970(v=vs.85).aspx

says

"If no extra information is required by the wFormatTag, this member must
be set to zero. For WAVE_FORMAT_PCM formats (and only WAVE_FORMAT_PCM
formats), this member is ignored. However it is still recommended to set
the value."

And not writing the cbSize doesn't make the header a WAVFORMAT one as
wBitsPerSample is written also. So if your description of the bug and
fix does what you say the patch is wrong. And the correct fix is to
always generate a valid header in ff_put_wav_header().

MvH
Benjamin Larsson
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to