[FFmpeg-devel] [PATCH] ff_put_wav_header: add flag to force WAVEFORMATEX

Daniel Verkamp daniel at drv.nu
Tue Apr 29 05:17:39 CEST 2014


On Mon, Apr 28, 2014 at 11:15 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Apr 27, 2014 at 11:49:15PM -0700, Daniel Verkamp wrote:
>> Partially undoes commit 2c4e08d89327595f7f4be57dda4b3775e1198d5e:
>>
>>     riff: always generate a proper WAVEFORMATEX structure in
>>     ff_put_wav_header
>>
>> A new flag, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX, is added to force the
>> use of WAVEFORMATEX rather than PCMWAVEFORMAT even for PCM codecs.
>>
>> This flag is used in the Matroska muxer (the cause of the original
>> change) and in the ASF muxer, because the specifications for
>> these formats indicate explicitly that WAVEFORMATEX should be used.
>>
>> Muxers for other formats will return to the original behavior of writing
>> PCMWAVEFORMAT when writing a header for raw PCM.
>>
>> In particular, this causes raw PCM in WAV to generate the canonical
>> 44-byte header expected by some tools.
>> ---
>>  libavformat/asfenc.c      |  2 +-
>>  libavformat/avienc.c      |  2 +-
>>  libavformat/matroskaenc.c |  2 +-
>>  libavformat/movenc.c      |  4 ++--
>>  libavformat/riff.h        | 16 +++++++++++++++-
>>  libavformat/riffenc.c     |  6 ++++--
>>  libavformat/wavenc.c      |  4 ++--
>>  libavformat/wtvenc.c      |  2 +-
>>  8 files changed, 27 insertions(+), 11 deletions(-)
>
> this changes several fate checksums
> assuming they are all intended to change, please include the checksum
> update in the patch

The checksums are the same as the ones before
2c4e08d89327595f7f4be57dda4b3775e1198d5e, with the exception of the
ADPCM codecs, which changed due to unrelated ADPCM decoder fixes in
the interim.

The only changes should be to output WAV files and PCM input WAV
files; these should shrink by two bytes (ditto for the seek test
positions on PCM WAV files).

I will send an updated patch including the FATE changes.

Thanks,
-- Daniel


More information about the ffmpeg-devel mailing list