[FFmpeg-devel] [PATCH 1/5] lavfi: add internal functions for parsing format arguments

Mina Nagy Zaki mnzaki at gmail.com
Fri Aug 12 11:36:38 CEST 2011


On Mon, Aug 08, 2011 at 02:04:29PM -0400, Justin Ruggles wrote:
> On 08/08/2011 11:36 AM, Mina Nagy Zaki wrote:
> 
> > +int64_t ff_parse_channel_layout(char *arg, void *log_ctx)
> > +{
> > +    char *tail;
> > +    int64_t chlayout = av_get_channel_layout(arg);
> > +    if (chlayout <= 0) {
> > +        chlayout = strtol(arg, &tail, 0);
> > +        if (*tail || chlayout <= 0) {
> 
> 
> This would preclude using the high bit for a channel mask value should
> it be needed someday. There is nowhere else I can find where
> channel_mask < 0 is not allowed.

While I don't see when ffmpeg/libav will support 64 audio channels, I suppose
this makes sense for completeness sake.

> 
> > +            av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
> > +            return AVERROR(EINVAL);
> > +        }
> > +    }
> > +    return chlayout;
> > +}
> 
> 
> -Justin



More information about the ffmpeg-devel mailing list