[FFmpeg-devel] Set channel_layout in mpegaudio
Ronald S. Bultje
rsbultje
Thu Feb 10 19:10:22 CET 2011
Hi,
On Mon, Feb 7, 2011 at 6:10 PM, Justin Ruggles <justin.ruggles at gmail.com> wrote:
> On 02/07/2011 06:01 PM, Baptiste Coudurier wrote:
>> 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.
>
>
> We do not have "dual mono" per-se but we can do:
> channel_layout = AV_CH_FRONT_CENTER | AV_CH_LOW_FREQUENCY
How do I detect that in mp3? Grep shows no hit for any such a term, so
I don't really know when to set it.
I guess I could look it up in the spec.
Ronald
More information about the ffmpeg-devel
mailing list