From 9eda2a85c64e5551fd5ee47285834e7b33b48080 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 27 Oct 2012 19:11:04 +0100 Subject: configure: remove support for -n flag in print_enabled() This flag is no longer used. Signed-off-by: Mans Rullgard --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index a66a7ffce3..163b742412 100755 --- a/configure +++ b/configure @@ -592,11 +592,10 @@ print_config(){ } print_enabled(){ - test x"$1" = x-n && end=" " && shift || end="\n" suf=$1 shift for v; do - enabled $v && printf "%s$end" ${v%$suf}; + enabled $v && printf "%s\n" ${v%$suf}; done } -- cgit v1.2.3 From 031aac9861dbd2d6e195f63e585cebe711db9d49 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 10 Nov 2012 13:16:29 +0000 Subject: ppc: fix some unused variable warnings The third argument of OP_U8_ALTIVEC is evaluated at most once so there is no need for a potentially unused temporary variable. Signed-off-by: Mans Rullgard --- libavcodec/ppc/h264_altivec_template.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libavcodec/ppc/h264_altivec_template.c b/libavcodec/ppc/h264_altivec_template.c index 0964bbebf8..b445f926a7 100644 --- a/libavcodec/ppc/h264_altivec_template.c +++ b/libavcodec/ppc/h264_altivec_template.c @@ -322,7 +322,7 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i pp1A, pp1B, pp2A, pp2B, pp3A, pp3B, psumA, psumB, sumA, sumB; - vec_u8 sum, vdst, fsum; + vec_u8 sum, fsum; for (i = 0 ; i < 16 ; i ++) { vec_u8 srcR1 = vec_ld(-2, src); @@ -423,9 +423,8 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i sum = vec_packsu(sumA, sumB); ASSERT_ALIGNED(dst); - vdst = vec_ld(0, dst); - OP_U8_ALTIVEC(fsum, sum, vdst); + OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); vec_st(fsum, 0, dst); @@ -486,7 +485,7 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i srcP3ssA, srcP3ssB, sum1A, sum1B, sum2A, sum2B, sum3A, sum3B; - vec_u8 sum, vdst, fsum, srcP3a, srcP3b, srcP3; + vec_u8 sum, fsum, srcP3a, srcP3b, srcP3; for (i = 0 ; i < 16 ; i++) { srcP3a = vec_ld(0, srcbis += srcStride); @@ -532,9 +531,8 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i sum = vec_packsu(sumA, sumB); ASSERT_ALIGNED(dst); - vdst = vec_ld(0, dst); - OP_U8_ALTIVEC(fsum, sum, vdst); + OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); vec_st(fsum, 0, dst); @@ -582,7 +580,7 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, pp3Ae, pp3Ao, pp3Be, pp3Bo, pp1cAe, pp1cAo, pp1cBe, pp1cBo, pp32Ae, pp32Ao, pp32Be, pp32Bo, sumAe, sumAo, sumBe, sumBo, ssumAe, ssumAo, ssumBe, ssumBo; - vec_u8 fsum, sumv, sum, vdst; + vec_u8 fsum, sumv, sum; vec_s16 ssume, ssumo; src -= (2 * srcStride); @@ -766,9 +764,8 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, sum = vec_perm(sumv, sumv, mperm); ASSERT_ALIGNED(dst); - vdst = vec_ld(0, dst); - OP_U8_ALTIVEC(fsum, sum, vdst); + OP_U8_ALTIVEC(fsum, sum, vec_ld(0, dst)); vec_st(fsum, 0, dst); -- cgit v1.2.3 From a384f6a7f73a8bd53046dd95a1ca0ac785d4add3 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 10 Nov 2012 13:21:52 +0000 Subject: ppc: replace pointer casting with AV_COPY32 This removes warnings about strict aliasing violations. Signed-off-by: Mans Rullgard --- libavcodec/ppc/h264_altivec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/ppc/h264_altivec.c b/libavcodec/ppc/h264_altivec.c index 05a5c51d38..73e2adb776 100644 --- a/libavcodec/ppc/h264_altivec.c +++ b/libavcodec/ppc/h264_altivec.c @@ -19,6 +19,7 @@ */ #include "libavutil/cpu.h" +#include "libavutil/intreadwrite.h" #include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/util_altivec.h" #include "libavcodec/dsputil.h" @@ -788,7 +789,7 @@ static inline vec_u8 h264_deblock_q1(register vec_u8 p0, alphavec = vec_splat(alphavec, 0x0); \ mask = h264_deblock_mask(p0, p1, q0, q1, alphavec, betavec); /*if in block */ \ \ - *((int *)temp) = *((int *)tc0); \ + AV_COPY32(temp, tc0); \ tc0vec = vec_ld(0, (signed char*)temp); \ tc0vec = vec_mergeh(tc0vec, tc0vec); \ tc0vec = vec_mergeh(tc0vec, tc0vec); \ -- cgit v1.2.3 From 5595368bcc6df7d307876bc051f41a8c72f38ce9 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 11:07:16 -0400 Subject: amr: set channel_layout --- libavformat/amr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/amr.c b/libavformat/amr.c index cc4842ebd5..ba91d7c139 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -25,6 +25,8 @@ Write and read amr data according to RFC3267, http://www.ietf.org/rfc/rfc3267.tx Only mono files are supported. */ + +#include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" @@ -97,6 +99,7 @@ static int amr_read_header(AVFormatContext *s) st->codec->sample_rate = 8000; } st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO; avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); -- cgit v1.2.3 From 39f0e9b8c6f7d99cbf0a3c1784eb6f20bf88ac3a Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 11:25:52 -0400 Subject: apc: set channel layout --- libavformat/apc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libavformat/apc.c b/libavformat/apc.c index 7ae2423cf8..0b6c5836c1 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -20,6 +20,8 @@ */ #include + +#include "libavutil/channel_layout.h" #include "avformat.h" static int apc_probe(AVProbeData *p) @@ -58,9 +60,13 @@ static int apc_read_header(AVFormatContext *s) /* initial predictor values for adpcm decoder */ avio_read(pb, st->codec->extradata, 2 * 4); - st->codec->channels = 1; - if (avio_rl32(pb)) - st->codec->channels = 2; + if (avio_rl32(pb)) { + 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->bits_per_coded_sample = 4; st->codec->bit_rate = st->codec->bits_per_coded_sample * st->codec->channels -- cgit v1.2.3 From b5d1a15d1b298f466c848c0454ef546ec135be14 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:05:36 -0400 Subject: bethsoftvid: set channel layout --- libavformat/bethsoftvid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index ece230ccb7..3a102c0b72 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -27,6 +27,7 @@ * @see http://www.svatopluk.com/andux/docs/dfvid.html */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -239,6 +240,7 @@ static int vid_read_packet(AVFormatContext *s, st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_PCM_U8; st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->bits_per_coded_sample = 8; st->codec->sample_rate = vid->sample_rate; st->codec->bit_rate = 8 * st->codec->sample_rate; -- cgit v1.2.3 From ff50d27a6391663be2332ec242de23131ac74034 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:06:41 -0400 Subject: bfi: set channel layout --- libavformat/bfi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/bfi.c b/libavformat/bfi.c index c520bea136..e60bbf4cab 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -26,6 +26,7 @@ * @see http://wiki.multimedia.cx/index.php?title=BFI */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -96,6 +97,7 @@ static int bfi_read_header(AVFormatContext * s) astream->codec->codec_type = AVMEDIA_TYPE_AUDIO; astream->codec->codec_id = AV_CODEC_ID_PCM_U8; astream->codec->channels = 1; + astream->codec->channel_layout = AV_CH_LAYOUT_MONO; astream->codec->bits_per_coded_sample = 8; astream->codec->bit_rate = astream->codec->sample_rate * astream->codec->bits_per_coded_sample; -- cgit v1.2.3 From 2fe804f316db5d58974d43f05299cc6d14b975ed Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:10:46 -0400 Subject: bink: set channel layout --- libavformat/bink.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/bink.c b/libavformat/bink.c index 7254caf575..5d3de14567 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -28,6 +28,7 @@ * http://wiki.multimedia.cx/index.php?title=Bink_Container */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -141,7 +142,13 @@ static int read_header(AVFormatContext *s) flags = avio_rl16(pb); ast->codec->codec_id = flags & BINK_AUD_USEDCT ? AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT; - ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1; + if (flags & BINK_AUD_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->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); if (!ast->codec->extradata) return AVERROR(ENOMEM); -- cgit v1.2.3 From e8088d6e4b1255a8a5969ef925e4eb3a01f0988b Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:12:35 -0400 Subject: bmv: set channel layout --- libavformat/bmv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/bmv.c b/libavformat/bmv.c index fe5db3f004..ce157e842e 100644 --- a/libavformat/bmv.c +++ b/libavformat/bmv.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" @@ -58,6 +59,7 @@ static int bmv_read_header(AVFormatContext *s) ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = AV_CODEC_ID_BMV_AUDIO; ast->codec->channels = 2; + ast->codec->channel_layout = AV_CH_LAYOUT_STEREO; ast->codec->sample_rate = 22050; avpriv_set_pts_info(ast, 16, 1, 22050); -- cgit v1.2.3 From 0d09a5848f49d37d77980f28cde9ad1987ce1eb4 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:49:11 -0400 Subject: cdxl: set channel layout --- libavformat/cdxl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/cdxl.c b/libavformat/cdxl.c index d61cbd9a3d..a2cba526ca 100644 --- a/libavformat/cdxl.c +++ b/libavformat/cdxl.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/parseutils.h" #include "libavutil/opt.h" @@ -101,7 +102,13 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt) st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 0; st->codec->codec_id = AV_CODEC_ID_PCM_S8; - st->codec->channels = cdxl->header[1] & 0x10 ? 2 : 1; + if (cdxl->header[1] & 0x10) { + 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 = cdxl->sample_rate; st->start_time = 0; cdxl->audio_stream_index = st->index; -- cgit v1.2.3 From a05a63785c4769a1f3c3cddcc876c5acb6cf4c83 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:55:12 -0400 Subject: daud: set channel layout Update FATE reference due to WAVE channel mask now being set correctly. --- libavformat/daud.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/daud.c b/libavformat/daud.c index dda83f95a5..3ceb958d61 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.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" static int daud_header(AVFormatContext *s) { @@ -28,6 +30,7 @@ static int daud_header(AVFormatContext *s) { st->codec->codec_id = AV_CODEC_ID_PCM_S24DAUD; st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd'); st->codec->channels = 6; + st->codec->channel_layout = AV_CH_LAYOUT_5POINT1; st->codec->sample_rate = 96000; st->codec->bit_rate = 3 * 6 * 96000 * 8; st->codec->block_align = 3 * 6; -- cgit v1.2.3 From 49e7af06f2fc68c9031cf7b67fe1cba066e2ace2 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:56:51 -0400 Subject: dsicin: set channel layout --- libavformat/dsicin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 8cba461487..ecc8c0b6af 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -24,6 +24,7 @@ * Delphine Software International CIN file demuxer */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -131,6 +132,7 @@ static int cin_read_header(AVFormatContext *s) st->codec->codec_id = AV_CODEC_ID_DSICINAUDIO; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->sample_rate = 22050; st->codec->bits_per_coded_sample = 8; st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels; -- cgit v1.2.3 From d5ca70b10302b47c70c6bc25400125b30d2ef619 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 12:59:32 -0400 Subject: dv: set channel layout --- libavformat/dv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/dv.c b/libavformat/dv.c index 5ce73f7a2a..1730972213 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -33,6 +33,7 @@ #include "internal.h" #include "libavcodec/dv_profile.h" #include "libavcodec/dvdata.h" +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" #include "dv.h" @@ -246,6 +247,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) } c->ast[i]->codec->sample_rate = dv_audio_frequency[freq]; c->ast[i]->codec->channels = 2; + c->ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO; c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16; c->ast[i]->start_time = 0; } -- cgit v1.2.3 From 644d8d2e5abcad4e6cd2d5761b4f97813fbda96f Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 13:31:40 -0400 Subject: flvdec: set channel layout --- libavformat/flvdec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 868cc6b793..7d5ea56cdd 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -25,6 +25,7 @@ */ #include "libavutil/avstring.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/opt.h" #include "libavutil/intfloat.h" @@ -749,6 +750,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; if(!st->codec->channels || !st->codec->sample_rate || !st->codec->bits_per_coded_sample) { st->codec->channels = channels; + st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO : + AV_CH_LAYOUT_STEREO; st->codec->sample_rate = sample_rate; st->codec->bits_per_coded_sample = bits_per_coded_sample; } @@ -794,6 +797,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata, st->codec->extradata_size * 8, 1); st->codec->channels = cfg.channels; + st->codec->channel_layout = 0; if (cfg.ext_sample_rate) st->codec->sample_rate = cfg.ext_sample_rate; else -- cgit v1.2.3 From d4a105ae5c1b0c6118872c8b729c3ac751281ed0 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 13:51:42 -0400 Subject: gsmdec: set channel layout --- libavformat/gsmdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/gsmdec.c b/libavformat/gsmdec.c index f0cb2799bf..f9ecbafcda 100644 --- a/libavformat/gsmdec.c +++ b/libavformat/gsmdec.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/channel_layout.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "avformat.h" @@ -64,6 +65,7 @@ static int gsm_read_header(AVFormatContext *s) st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s->iformat->raw_codec_id; st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->sample_rate = c->sample_rate; st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES; -- cgit v1.2.3 From f6c3adde41921082964055193efbcf58195bf457 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 14:00:04 -0400 Subject: gxfdec: set channel layout when applicable --- libavformat/gxf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 2593c0642b..6feb3c30dc 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "avformat.h" #include "internal.h" @@ -119,6 +120,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_PCM_S24LE; st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->sample_rate = 48000; st->codec->bit_rate = 3 * 1 * 48000 * 8; st->codec->block_align = 3 * 1; @@ -128,6 +130,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_PCM_S16LE; st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; st->codec->sample_rate = 48000; st->codec->bit_rate = 2 * 1 * 48000 * 8; st->codec->block_align = 2 * 1; @@ -137,6 +140,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_AC3; st->codec->channels = 2; + st->codec->channel_layout = AV_CH_LAYOUT_STEREO; st->codec->sample_rate = 48000; break; // timecode tracks: -- cgit v1.2.3 From 73e2007f3d435dec6a5ddb6a47e706cc419eb7cd Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 14:03:43 -0400 Subject: idroqdec: set channel layout --- libavformat/idroqdec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c index 521f586d90..eeaafec5aa 100644 --- a/libavformat/idroqdec.c +++ b/libavformat/idroqdec.c @@ -27,6 +27,7 @@ * http://www.csse.monash.edu.au/~timf/ */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -175,7 +176,14 @@ static int roq_read_packet(AVFormatContext *s, st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_ROQ_DPCM; st->codec->codec_tag = 0; /* no tag */ - st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; + if (chunk_type == RoQ_SOUND_STEREO) { + 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; + } + roq->audio_channels = st->codec->channels; st->codec->sample_rate = RoQ_AUDIO_SAMPLE_RATE; st->codec->bits_per_coded_sample = 16; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * -- cgit v1.2.3 From 024e03701c706d3976348b9f50a1af7db2137a39 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 14:05:45 -0400 Subject: iff: set channel layout --- libavformat/iff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libavformat/iff.c b/libavformat/iff.c index c2bc283753..ab22e118f0 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -29,6 +29,7 @@ * http://wiki.multimedia.cx/index.php?title=IFF */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "libavutil/dict.h" #include "avformat.h" @@ -120,6 +121,7 @@ static int iff_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; avio_skip(pb, 8); // codec_tag used by ByteRun1 decoder to distinguish progressive (PBM) and interlaced (ILBM) content st->codec->codec_tag = avio_rl32(pb); @@ -154,7 +156,13 @@ static int iff_read_header(AVFormatContext *s) case ID_CHAN: if (data_size < 4) return AVERROR_INVALIDDATA; - st->codec->channels = (avio_rb32(pb) < 6) ? 1 : 2; + if (avio_rb32(pb) < 6) { + st->codec->channels = 1; + st->codec->channel_layout = AV_CH_LAYOUT_MONO; + } else { + st->codec->channels = 2; + st->codec->channel_layout = AV_CH_LAYOUT_STEREO; + } break; case ID_CMAP: -- cgit v1.2.3 From 41a2d9590d89c3f240b1ef875649852197d945eb Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 16:44:46 -0400 Subject: ipmovie: set channel layout --- libavformat/ipmovie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index b567fb2b14..60ae939003 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -32,6 +32,7 @@ * up and sending out the chunks. */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -600,6 +601,8 @@ static int ipmovie_read_header(AVFormatContext *s) st->codec->codec_id = ipmovie->audio_type; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = ipmovie->audio_channels; + st->codec->channel_layout = st->codec->channels == 1 ? AV_CH_LAYOUT_MONO : + AV_CH_LAYOUT_STEREO; st->codec->sample_rate = ipmovie->audio_sample_rate; st->codec->bits_per_coded_sample = ipmovie->audio_bits; st->codec->bit_rate = st->codec->channels * st->codec->sample_rate * -- cgit v1.2.3 From 43711312831504c42d2db3bbeafc893883bee911 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 16:45:48 -0400 Subject: iss: set channel layout --- libavformat/iss.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavformat/iss.c b/libavformat/iss.c index 14f64d2392..3f7f4feff2 100644 --- a/libavformat/iss.c +++ b/libavformat/iss.c @@ -26,6 +26,7 @@ * @see http://wiki.multimedia.cx/index.php?title=FunCom_ISS */ +#include "libavutil/channel_layout.h" #include "avformat.h" #include "internal.h" #include "libavutil/avstring.h" @@ -94,7 +95,13 @@ static av_cold int iss_read_header(AVFormatContext *s) return AVERROR(ENOMEM); st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_ISS; - st->codec->channels = stereo ? 2 : 1; + if (stereo) { + 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 = 44100; if(rate_divisor > 0) st->codec->sample_rate /= rate_divisor; -- cgit v1.2.3 From ef1b23ad21e3f12fc4ff2a73a6d4d4cd9d630c4b Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 7 Apr 2012 16:47:15 -0400 Subject: jvdec: set channel layout --- libavformat/jvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c index 47a6142403..cf9df8c977 100644 --- a/libavformat/jvdec.c +++ b/libavformat/jvdec.c @@ -25,6 +25,7 @@ * @author Peter Ross */ +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -91,6 +92,7 @@ static int read_header(AVFormatContext *s) ast->codec->codec_tag = 0; /* no fourcc */ ast->codec->sample_rate = avio_rl16(pb); ast->codec->channels = 1; + ast->codec->channel_layout = AV_CH_LAYOUT_MONO; avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate); avio_skip(pb, 10); -- cgit v1.2.3