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

Justin Ruggles justin.ruggles at gmx.com
Mon Aug 8 20:04:29 CEST 2011


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.

> +            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