From 87199d34db5d79ad85c0801b29db0709c08f458c Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 16:52:57 -0400 Subject: mm: set channel layout --- libavformat/mm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mm.c b/libavformat/mm.c index 13f33a23ad..83539fa242 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 */ } -- cgit v1.2.3 From f24b0b1b6cc3357637570d28f9a9fa285bec1770 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 16:56:48 -0400 Subject: mmf: set channel layout --- libavformat/mmf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 06d4a2b277..20570f2812 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -18,6 +18,8 @@ * License along with Libav; 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; -- cgit v1.2.3 From f6c6e5aac12edd02f5c62e2efa0d8f5af161eb88 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:03:19 -0400 Subject: mpc7: set channel layout --- libavformat/mpc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mpc.c b/libavformat/mpc.c index fbf8e92fd9..5e771ae4aa 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; -- cgit v1.2.3 From 66d7ceb4aa0a17c72de9a63748953d53a1e95a12 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:17:19 -0400 Subject: mvi: set channel layout --- libavformat/mvi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mvi.c b/libavformat/mvi.c index c5aee5a10d..10ec8bbb20 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; -- cgit v1.2.3 From cc57228e31ace7ab112b7fd86b31cc11dfb405f0 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:22:05 -0400 Subject: mxg: set channel layout --- libavformat/mxg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mxg.c b/libavformat/mxg.c index 09653ee7b7..8959134769 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; -- cgit v1.2.3 From 232e9c4c4bed38d54c9c55efb8ffc2b12d55b427 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:35:20 -0400 Subject: nuv: set channel layout --- libavformat/nuv.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/nuv.c b/libavformat/nuv.c index fce96b420c..2cbf348971 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; -- cgit v1.2.3 From d4088efbe22f2e4f8fc10d63bb50835779a702be Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:39:30 -0400 Subject: oggparsespeex: validate channel count and set channel layout --- libavformat/oggparsespeex.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavformat') 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 #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); -- cgit v1.2.3 From c9759eb426ea997822bf5e6cc43bb24b249e9e25 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:53:39 -0400 Subject: omadec: set channel layout --- libavformat/omadec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 022942d242..9b229994ba 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" @@ -312,6 +313,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; @@ -346,6 +348,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 */ -- cgit v1.2.3 From b5e3e77711c6a4bef8b343d4d419e7ca67425fbc Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:56:19 -0400 Subject: psxstr: set channel layout --- libavformat/psxstr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index 800d9cbcf3..633d61dd44 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" @@ -219,7 +220,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; -- cgit v1.2.3 From 444b79c18acc057082a2fbdd8d0bedefafbea5fd Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 17:57:25 -0400 Subject: qcp: set channel layout --- libavformat/qcp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/qcp.c b/libavformat/qcp.c index bde59901ef..30d362f938 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; -- cgit v1.2.3 From 60a585304c285f44a233a4721238d5ad81697627 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:01:27 -0400 Subject: rmdec: set channel layout for RA version 3 --- libavformat/rmdec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 07d218e311..aff21fbbd5 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -20,6 +20,7 @@ */ #include "libavutil/avstring.h" +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/dict.h" #include "avformat.h" @@ -140,6 +141,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; -- cgit v1.2.3 From ce842029ce97ea3eb49854fc71ad288246eb76d1 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:18:37 -0400 Subject: rsodec: set channel layout --- libavformat/rsodec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c index f5bcebb7f2..c3016ca332 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); -- cgit v1.2.3 From c1ac602d53ab250fd1ef37867e18191c55cc5e4f Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:24:45 -0400 Subject: rtpdec_amr: set channel layout --- libavformat/rtpdec_amr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c index cc43e31e6d..1e60287465 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 -- cgit v1.2.3 From a634896cf81b8d057a526d6ad24eb9bdfe46a855 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:32:13 -0400 Subject: sierravmd: set channel layout --- libavformat/sierravmd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 6490fddc5d..359282c875 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" @@ -132,7 +133,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) { -- cgit v1.2.3 From 57e590e4b8b94238800b36695f07d5cf4a4832ac Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:36:08 -0400 Subject: siff: set channel layout --- libavformat/siff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/siff.c b/libavformat/siff.c index 02af80bfab..8ba7c6007f 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" @@ -78,6 +79,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); -- cgit v1.2.3 From bfccd76adb514f6bf3dd4bf7f429ca58000f513e Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:36:49 -0400 Subject: smacker: set channel layout --- libavformat/smacker.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/smacker.c b/libavformat/smacker.c index dcca1afd37..17c7c529e7 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) -- cgit v1.2.3 From 1c7587728c81fcb8209ae079a1bc0ccc6b03b4c2 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:38:29 -0400 Subject: sol: set channel layout --- libavformat/sol.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/sol.c b/libavformat/sol.c index da846002e8..92599b163d 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; -- cgit v1.2.3 From a3949fe11fc73ef45f87ec045cc2c0a6f19a4052 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:42:26 -0400 Subject: swfdec: set channel layout --- libavformat/swfdec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index ff44452f8f..f105c141c6 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.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 "swf.h" @@ -139,7 +140,13 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) if (!ast) return -1; 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; -- cgit v1.2.3 From 7f348bd764e1ff85054f1da5291f18c0e7f8f39b Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:44:20 -0400 Subject: tiertexseq: set channel layout --- libavformat/tiertexseq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c index 5582890cca..45300f9e8a 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; -- cgit v1.2.3 From a94b0267f2e12861b6f78388cdeba29f1240be48 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:45:49 -0400 Subject: tmv: set channel layout --- libavformat/tmv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 100e12fa53..103ac4af20 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; -- cgit v1.2.3 From 2ce7f820d46aa268c3f903674c993362f875890d Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:49:09 -0400 Subject: wc3movie: set channel layout --- libavformat/wc3movie.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index 117e4ead47..c8942537cb 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 * -- cgit v1.2.3 From 7b48d93e8abb8736f52548d02ca5d6137d441ba4 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:50:41 -0400 Subject: westwood_aud: set channel layout --- libavformat/westwood_aud.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c index 806aea66ea..2a06c2952b 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" @@ -120,6 +121,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; -- cgit v1.2.3 From 935fbb66ef325019ee5a64d1efae69282c68d050 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:55:43 -0400 Subject: wtv: set channel layout for mpeg audio --- libavformat/wtv.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libavformat') diff --git a/libavformat/wtv.c b/libavformat/wtv.c index 57d239eb88..7bb421b0ce 100644 --- a/libavformat/wtv.c +++ b/libavformat/wtv.c @@ -25,6 +25,7 @@ * @author Peter Ross */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" #include "libavutil/dict.h" @@ -618,8 +619,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; } } -- cgit v1.2.3 From b9629acb6b647b31b8b4e3932e836189bd03e5b9 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 18:59:00 -0400 Subject: yop: set channel layout --- libavformat/yop.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/yop.c b/libavformat/yop.c index 51d088bdd2..351938b7e9 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" @@ -74,6 +75,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 -- cgit v1.2.3