[FFmpeg-devel] Set channel_layout in mpegaudio

Baptiste Coudurier baptiste.coudurier
Tue Feb 8 00:01:02 CET 2011


On 02/05/2011 10:01 AM, Kieran Kunhya wrote:
> $subj
>
>
> 0001-Set-channel_layout-for-mpegaudio.patch
>
>
>  From 112c79fe16957a6badc20eb69cdfdb0b5eed270b Mon Sep 17 00:00:00 2001
> From: Kieran Kunhya<kieran at kunhya.com>
> Date: Sat, 5 Feb 2011 17:59:48 +0000
> Subject: [PATCH] Set channel_layout for mpegaudio
>
> ---
>   libavcodec/mpegaudiodec.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
> index 0cd0b68..6fa3d85 100644
> --- a/libavcodec/mpegaudiodec.c
> +++ b/libavcodec/mpegaudiodec.c
> @@ -2054,6 +2054,7 @@ static int decode_frame(AVCodecContext * avctx,
>       }
>       /* update codec info */
>       avctx->channels = s->nb_channels;
> +    avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;

Do we have dual mono layout as well ? mpegaudio can specify that as well 
IIRC, to carry CENTER+LFE as a pair for example.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list