From eeee48b26b6cfc2e8595071a806a8641a99cd71f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 19 Nov 2008 14:57:48 +0000 Subject: [PATCH] Add channel layout to several audio decoders I maintain Originally committed as revision 15884 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/apedec.c | 1 + libavcodec/mpc7.c | 1 + libavcodec/mpc8.c | 1 + libavcodec/smacker.c | 1 + libavcodec/wavpack.c | 1 + 5 files changed, 5 insertions(+) diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 82d567f4cf..8746724133 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -199,6 +199,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx) dsputil_init(&s->dsp, avctx); avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO; return 0; } diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 565b8589ec..2db417280c 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -109,6 +109,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) } vlc_initialized = 1; avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO; return 0; } diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 0d4f128912..c47e74dde2 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -178,6 +178,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) } vlc_initialized = 1; avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO; return 0; } diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 1690518b6b..5de3769e3c 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -559,6 +559,7 @@ static av_cold int decode_end(AVCodecContext *avctx) static av_cold int smka_decode_init(AVCodecContext *avctx) { avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO; return 0; } diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index e8703b38dc..b89723e2f2 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -361,6 +361,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx) s->avctx = avctx; s->stereo = (avctx->channels == 2); avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO; return 0; }