aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 11:09:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 11:09:38 +0100
commit799d749c77de28a6790db48b3465ecdc56822d96 (patch)
tree79e62292d12bb4615ba643f2d351d9e6657099e0
parent7eb40d85f2258df31287dc7a0704cb35e356c077 (diff)
parentb9629acb6b647b31b8b4e3932e836189bd03e5b9 (diff)
downloadffmpeg-799d749c77de28a6790db48b3465ecdc56822d96.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (24 commits) yop: set channel layout wtv: set channel layout for mpeg audio westwood_aud: set channel layout wc3movie: set channel layout tmv: set channel layout tiertexseq: set channel layout swfdec: set channel layout sol: set channel layout smacker: set channel layout siff: set channel layout sierravmd: set channel layout rtpdec_amr: set channel layout rsodec: set channel layout rmdec: set channel layout for RA version 3 qcp: set channel layout psxstr: set channel layout omadec: set channel layout oggparsespeex: validate channel count and set channel layout nuv: set channel layout mxg: set channel layout ... Conflicts: libavformat/swfdec.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mm.c2
-rw-r--r--libavformat/mmf.c3
-rw-r--r--libavformat/mpc.c2
-rw-r--r--libavformat/mvi.c2
-rw-r--r--libavformat/mxg.c2
-rw-r--r--libavformat/nuv.c3
-rw-r--r--libavformat/oggparsespeex.c7
-rw-r--r--libavformat/omadec.c3
-rw-r--r--libavformat/psxstr.c9
-rw-r--r--libavformat/qcp.c2
-rw-r--r--libavformat/rmdec.c2
-rw-r--r--libavformat/rsodec.c2
-rw-r--r--libavformat/rtpdec_amr.c2
-rw-r--r--libavformat/sierravmd.c9
-rw-r--r--libavformat/siff.c2
-rw-r--r--libavformat/smacker.c9
-rw-r--r--libavformat/sol.c3
-rw-r--r--libavformat/swfdec.c9
-rw-r--r--libavformat/tiertexseq.c2
-rw-r--r--libavformat/tmv.c9
-rw-r--r--libavformat/wc3movie.c2
-rw-r--r--libavformat/westwood_aud.c3
-rw-r--r--libavformat/wtvdec.c11
-rw-r--r--libavformat/yop.c2
24 files changed, 95 insertions, 7 deletions
diff --git a/libavformat/mm.c b/libavformat/mm.c
index 125a6773c4..12a11ac69d 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -31,6 +31,7 @@
* http://wiki.multimedia.cx/index.php?title=American_Laser_Games_MM
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -124,6 +125,7 @@ static int read_header(AVFormatContext *s)
st->codec->codec_tag = 0; /* no fourcc */
st->codec->codec_id = AV_CODEC_ID_PCM_U8;
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = 8000;
avpriv_set_pts_info(st, 64, 1, 8000); /* 8000 hz */
}
diff --git a/libavformat/mmf.c b/libavformat/mmf.c
index 18b69d471f..e77137f290 100644
--- a/libavformat/mmf.c
+++ b/libavformat/mmf.c
@@ -18,6 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
@@ -249,6 +251,7 @@ static int mmf_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_ADPCM_YAMAHA;
st->codec->sample_rate = rate;
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->bits_per_coded_sample = 4;
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample;
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index 3b818ed146..b0f6f533e1 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "internal.h"
@@ -91,6 +92,7 @@ static int mpc_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_MUSEPACK7;
st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->bits_per_coded_sample = 16;
st->codec->extradata_size = 16;
diff --git a/libavformat/mvi.c b/libavformat/mvi.c
index 0833e11b5e..6ab95b90b0 100644
--- a/libavformat/mvi.c
+++ b/libavformat/mvi.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
@@ -81,6 +82,7 @@ static int read_header(AVFormatContext *s)
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
ast->codec->channels = 1;
+ ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
ast->codec->bits_per_coded_sample = 8;
ast->codec->bit_rate = ast->codec->sample_rate * 8;
diff --git a/libavformat/mxg.c b/libavformat/mxg.c
index be7e6db1c4..d911a33e7f 100644
--- a/libavformat/mxg.c
+++ b/libavformat/mxg.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/mjpeg.h"
#include "avformat.h"
@@ -56,6 +57,7 @@ static int mxg_read_header(AVFormatContext *s)
audio_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
audio_st->codec->codec_id = AV_CODEC_ID_PCM_ALAW;
audio_st->codec->channels = 1;
+ audio_st->codec->channel_layout = AV_CH_LAYOUT_MONO;
audio_st->codec->sample_rate = 8000;
audio_st->codec->bits_per_coded_sample = 8;
audio_st->codec->block_align = 1;
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index c192faad98..c67c1fa695 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "avformat.h"
@@ -99,6 +100,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst,
ast->codec->sample_rate = avio_rl32(pb);
ast->codec->bits_per_coded_sample = avio_rl32(pb);
ast->codec->channels = avio_rl32(pb);
+ ast->codec->channel_layout = 0;
ast->codec->codec_id =
ff_wav_codec_get_id(ast->codec->codec_tag,
ast->codec->bits_per_coded_sample);
@@ -179,6 +181,7 @@ static int nuv_header(AVFormatContext *s) {
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
ast->codec->channels = 2;
+ ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
ast->codec->sample_rate = 44100;
ast->codec->bit_rate = 2 * 2 * 44100 * 8;
ast->codec->block_align = 2 * 2;
diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c
index 11b50d5905..42480a3a27 100644
--- a/libavformat/oggparsespeex.c
+++ b/libavformat/oggparsespeex.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "libavutil/bswap.h"
#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/bytestream.h"
#include "avformat.h"
@@ -59,6 +60,12 @@ static int speex_header(AVFormatContext *s, int idx) {
st->codec->sample_rate = AV_RL32(p + 36);
st->codec->channels = AV_RL32(p + 48);
+ if (st->codec->channels < 1 || st->codec->channels > 2) {
+ av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");
+ return AVERROR_INVALIDDATA;
+ }
+ st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO :
+ AV_CH_LAYOUT_STEREO;
spxp->packet_size = AV_RL32(p + 56);
frames_per_packet = AV_RL32(p + 64);
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 5f7669a0a7..59fff73b2f 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -40,6 +40,7 @@
* CODEC SUPPORT: Only ATRAC3 codec is currently supported!
*/
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
@@ -318,6 +319,7 @@ static int oma_read_header(AVFormatContext *s)
framesize = (codec_params & 0x3FF) * 8;
jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */
st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = samplerate;
st->codec->bit_rate = st->codec->sample_rate * framesize * 8 / 1024;
@@ -352,6 +354,7 @@ static int oma_read_header(AVFormatContext *s)
case OMA_CODECID_LPCM:
/* PCM 44.1 kHz 16 bit stereo big-endian */
st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = 44100;
framesize = 1024;
/* bit rate = sample rate x PCM block align (= 4) x 8 */
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c
index 86fba163ea..35a6d71c5e 100644
--- a/libavformat/psxstr.c
+++ b/libavformat/psxstr.c
@@ -29,6 +29,7 @@
* RIFF headers, followed by CD sectors.
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -253,7 +254,13 @@ static int str_read_packet(AVFormatContext *s,
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_ADPCM_XA;
st->codec->codec_tag = 0; /* no fourcc */
- st->codec->channels = (fmt&1)?2:1;
+ if (fmt & 1) {
+ st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
st->codec->sample_rate = (fmt&4)?18900:37800;
// st->codec->bit_rate = 0; //FIXME;
st->codec->block_align = 128;
diff --git a/libavformat/qcp.c b/libavformat/qcp.c
index 11fc71a466..3cb85fb00a 100644
--- a/libavformat/qcp.c
+++ b/libavformat/qcp.c
@@ -27,6 +27,7 @@
* http://tools.ietf.org/html/rfc3625
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
@@ -96,6 +97,7 @@ static int qcp_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
avio_read(pb, buf, 16);
if (is_qcelp_13k_guid(buf)) {
st->codec->codec_id = AV_CODEC_ID_QCELP;
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index a2c8bfbe9c..ffc6e5be4d 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -21,6 +21,7 @@
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -141,6 +142,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
avio_skip(pb, header_size + startpos - avio_tell(pb));
st->codec->sample_rate = 8000;
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_RA_144;
ast->deint_id = DEINT_ID_INT0;
diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c
index 7a22217a63..1b3a536245 100644
--- a/libavformat/rsodec.c
+++ b/libavformat/rsodec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -63,6 +64,7 @@ static int rso_read_header(AVFormatContext *s)
st->codec->codec_tag = id;
st->codec->codec_id = codec;
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = rate;
avpriv_set_pts_info(st, 64, 1, rate);
diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c
index 6051dce716..3f5e775110 100644
--- a/libavformat/rtpdec_amr.c
+++ b/libavformat/rtpdec_amr.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "rtpdec_formats.h"
#include "libavutil/avstring.h"
@@ -77,6 +78,7 @@ static int amr_handle_packet(AVFormatContext *ctx,
av_log(ctx, AV_LOG_ERROR, "Only mono AMR is supported\n");
return AVERROR_INVALIDDATA;
}
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
/* The AMR RTP packet consists of one header byte, followed
* by one TOC byte for each AMR frame in the packet, followed
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index a21ad1f1bc..f8a638a67a 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -27,6 +27,7 @@
* http://www.pcisys.net/~melanson/codecs/
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -133,7 +134,13 @@ static int vmd_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_VMDAUDIO;
st->codec->codec_tag = 0; /* no fourcc */
- st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
+ if (vmd->vmd_header[811] & 0x80) {
+ st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
st->codec->sample_rate = vmd->sample_rate;
st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
if (st->codec->block_align & 0x8000) {
diff --git a/libavformat/siff.c b/libavformat/siff.c
index 26c381753b..8e7e5c7cf0 100644
--- a/libavformat/siff.c
+++ b/libavformat/siff.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -79,6 +80,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c)
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
ast->codec->channels = 1;
+ ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
ast->codec->bits_per_coded_sample = 8;
ast->codec->sample_rate = c->rate;
avpriv_set_pts_info(ast, 16, 1, c->rate);
diff --git a/libavformat/smacker.c b/libavformat/smacker.c
index 829233f032..be22bec683 100644
--- a/libavformat/smacker.c
+++ b/libavformat/smacker.c
@@ -24,6 +24,7 @@
*/
#include "libavutil/bswap.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -191,7 +192,13 @@ static int smacker_read_header(AVFormatContext *s)
} else {
ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8;
}
- ast[i]->codec->channels = (smk->aflags[i] & SMK_AUD_STEREO) ? 2 : 1;
+ if (smk->aflags[i] & SMK_AUD_STEREO) {
+ ast[i]->codec->channels = 2;
+ ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ ast[i]->codec->channels = 1;
+ ast[i]->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
ast[i]->codec->sample_rate = smk->rates[i];
ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & SMK_AUD_16BITS) ? 16 : 8;
if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == AV_CODEC_ID_PCM_U8)
diff --git a/libavformat/sol.c b/libavformat/sol.c
index aca5a860eb..77c754a77e 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -23,6 +23,7 @@
* Based on documents from Game Audio Player and own research
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -116,6 +117,8 @@ static int sol_read_header(AVFormatContext *s)
st->codec->codec_tag = id;
st->codec->codec_id = codec;
st->codec->channels = channels;
+ st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
+ AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = rate;
avpriv_set_pts_info(st, 64, 1, rate);
return 0;
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index 193df25e2f..6918b01de1 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -21,6 +21,7 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "swf.h"
@@ -194,7 +195,13 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!ast)
return AVERROR(ENOMEM);
ast->id = -1; /* -1 to avoid clash with video stream ch_id */
- ast->codec->channels = 1 + (v&1);
+ if (v & 1) {
+ ast->codec->channels = 2;
+ ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ ast->codec->channels = 1;
+ ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
ast->need_parsing = AVSTREAM_PARSE_FULL;
diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c
index 88941b7311..917a331444 100644
--- a/libavformat/tiertexseq.c
+++ b/libavformat/tiertexseq.c
@@ -24,6 +24,7 @@
* Tiertex Limited SEQ file demuxer
*/
+#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
@@ -231,6 +232,7 @@ static int seq_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
st->codec->codec_tag = 0; /* no tag */
st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->sample_rate = SEQ_SAMPLE_RATE;
st->codec->bits_per_coded_sample = 16;
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels;
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index acc3460cfd..8be4dbffaf 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -26,6 +26,7 @@
* @see http://www.oldskool.org/pc/8088_Corruption
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -112,7 +113,13 @@ static int tmv_read_header(AVFormatContext *s)
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
ast->codec->codec_id = AV_CODEC_ID_PCM_U8;
- ast->codec->channels = features & TMV_STEREO ? 2 : 1;
+ if (features & TMV_STEREO) {
+ ast->codec->channels = 2;
+ ast->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ ast->codec->channels = 1;
+ ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
ast->codec->bits_per_coded_sample = 8;
ast->codec->bit_rate = ast->codec->sample_rate *
ast->codec->bits_per_coded_sample;
diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index 836f567a20..657380a6be 100644
--- a/libavformat/wc3movie.c
+++ b/libavformat/wc3movie.c
@@ -27,6 +27,7 @@
* http://www.pcisys.net/~melanson/codecs/
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
@@ -183,6 +184,7 @@ static int wc3_read_header(AVFormatContext *s)
st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
st->codec->codec_tag = 1;
st->codec->channels = WC3_AUDIO_CHANNELS;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
st->codec->bits_per_coded_sample = WC3_AUDIO_BITS;
st->codec->sample_rate = WC3_SAMPLE_RATE;
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate *
diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c
index 8b02abdf48..f4b8584b26 100644
--- a/libavformat/westwood_aud.c
+++ b/libavformat/westwood_aud.c
@@ -33,6 +33,7 @@
* qualify a file. Refer to wsaud_probe() for the precise parameters.
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -118,6 +119,8 @@ static int wsaud_read_header(AVFormatContext *s)
avpriv_set_pts_info(st, 64, 1, sample_rate);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->channels = channels;
+ st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO :
+ AV_CH_LAYOUT_STEREO;
st->codec->sample_rate = sample_rate;
return 0;
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index c030ab6d69..c3f57504e9 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -25,6 +25,7 @@
* @author Peter Ross <pross@xvid.org>
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "avformat.h"
@@ -558,8 +559,14 @@ static void parse_mpeg1waveformatex(AVStream *st)
/* dwHeadMode */
switch (AV_RL16(st->codec->extradata + 6)) {
- case 1 : case 2 : case 4 : st->codec->channels = 2; break;
- case 8 : st->codec->channels = 1; break;
+ case 1 :
+ case 2 :
+ case 4 : st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ break;
+ case 8 : st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ break;
}
}
diff --git a/libavformat/yop.c b/libavformat/yop.c
index 2d89c6e3f2..58e31acad8 100644
--- a/libavformat/yop.c
+++ b/libavformat/yop.c
@@ -22,6 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -81,6 +82,7 @@ static int yop_read_header(AVFormatContext *s)
audio_dec->codec_type = AVMEDIA_TYPE_AUDIO;
audio_dec->codec_id = AV_CODEC_ID_ADPCM_IMA_APC;
audio_dec->channels = 1;
+ audio_dec->channels = AV_CH_LAYOUT_MONO;
audio_dec->sample_rate = 22050;
// Video