X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Friffenc.c;h=6c91cb693ac281162e69116f832380a8ab752abf;hb=cdc166acd80bf7de7338ac95b3f283dd531a9a06;hp=c3e3e66b3740d36bd91f1ee044154f257c93d581;hpb=fb61ed1e9fcac9163746ffe4a53c6aa2e284dde1;p=ffmpeg diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index c3e3e66b374..6c91cb693ac 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -172,12 +172,14 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc) } /* write WAVEFORMATEXTENSIBLE extensions */ if (waveformatextensible) { + int write_channel_mask = enc->strict_std_compliance < FF_COMPLIANCE_NORMAL || + enc->channel_layout < 0x40000; /* 22 is WAVEFORMATEXTENSIBLE size */ avio_wl16(pb, riff_extradata - riff_extradata_start + 22); /* ValidBitsPerSample || SamplesPerBlock || Reserved */ avio_wl16(pb, bps); /* dwChannelMask */ - avio_wl32(pb, enc->channel_layout); + avio_wl32(pb, write_channel_mask ? enc->channel_layout : 0); /* GUID + next 3 */ if (enc->codec_id == AV_CODEC_ID_EAC3) { ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids));