[FFmpeg-devel] [PATCH] Add asrc abuffer - audio source buffer for lavfi

Justin Ruggles justin.ruggles
Sat Sep 25 16:22:04 CEST 2010


S.N. Hemanth Meenakshisundaram wrote:

>  Removed the changes for separating audio/video pts.
> 
> This filter is needed for ffmpeg.c changes to use lavfi audio. 'make
> test' tests this filter every time an audio file test is done.
> 
> 

[...]
> +    abuffer->init_ch_layout = avcodec_get_channel_layout(ch_layout_str);
> +    if (abuffer->init_ch_layout < CH_LAYOUT_STEREO) {
> +        char *tail;
> +        abuffer->init_ch_layout = strtol(ch_layout_str, &tail, 10);
> +        if (*tail || abuffer->init_ch_layout < CH_LAYOUT_STEREO) {
> +            av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s\n", ch_layout_str);
> +            return AVERROR(EINVAL);
> +        }
> +    }

Why not use 0 as the base in strtol() instead of 10?  Using hexadecimal
for channel layouts is much more common than using decimal, so it would
be nice to be able to use it.  On a related note, it would be even
better to be able to use multiple channel names in the layout name like
we do for the output string (e.g. "FL|FR|LFE").

Also, why are CH_LAYOUT_MONO, CH_FRONT_LEFT, and CH_FRONT_RIGHT not
valid layouts?

-Justin



More information about the ffmpeg-devel mailing list