Commit 421c116f authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Fix a typo in amr.c.
  Remove an unneeded include of avassert.h from amr.c.
  Do not allow writing invalid wav channel layouts by default.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 849d40dc cf79f202
...@@ -26,7 +26,6 @@ Only mono files are supported. ...@@ -26,7 +26,6 @@ Only mono files are supported.
*/ */
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
...@@ -116,7 +115,7 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -116,7 +115,7 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR(EIO); return AVERROR(EIO);
} }
// FIXME this is wrong, this should rather be in a AVParset // FIXME this is wrong, this should rather be in a AVParser
toc = avio_r8(s->pb); toc = avio_r8(s->pb);
mode = (toc >> 3) & 0x0F; mode = (toc >> 3) & 0x0F;
......
...@@ -172,12 +172,14 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc) ...@@ -172,12 +172,14 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
} }
/* write WAVEFORMATEXTENSIBLE extensions */ /* write WAVEFORMATEXTENSIBLE extensions */
if (waveformatextensible) { if (waveformatextensible) {
int write_channel_mask = enc->strict_std_compliance < FF_COMPLIANCE_NORMAL ||
enc->channel_layout < 0x40000;
/* 22 is WAVEFORMATEXTENSIBLE size */ /* 22 is WAVEFORMATEXTENSIBLE size */
avio_wl16(pb, riff_extradata - riff_extradata_start + 22); avio_wl16(pb, riff_extradata - riff_extradata_start + 22);
/* ValidBitsPerSample || SamplesPerBlock || Reserved */ /* ValidBitsPerSample || SamplesPerBlock || Reserved */
avio_wl16(pb, bps); avio_wl16(pb, bps);
/* dwChannelMask */ /* dwChannelMask */
avio_wl32(pb, enc->channel_layout); avio_wl32(pb, write_channel_mask ? enc->channel_layout : 0);
/* GUID + next 3 */ /* GUID + next 3 */
if (enc->codec_id == AV_CODEC_ID_EAC3) { if (enc->codec_id == AV_CODEC_ID_EAC3) {
ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids)); ff_put_guid(pb, get_codec_guid(enc->codec_id, ff_codec_wav_guids));
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 55 #define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 36 #define LIBAVFORMAT_VERSION_MINOR 36
#define LIBAVFORMAT_VERSION_MICRO 102 #define LIBAVFORMAT_VERSION_MICRO 103
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \
......
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