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

Stefano Sabatini stefano.sabatini-lala at poste.it
Tue Aug 9 00:15:03 CEST 2011


On date Monday 2011-08-08 14:04:29 -0400, Justin Ruggles encoded:
> 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.

So I suggest:
int ff_parse_channel_layout(int64_t *chlayout, const char *arg, void *log_ctx)

and follow the same pattern for the other ff_parse_*, more generic and
more consistent with the API.
-- 
FFmpeg = Fundamentalist and Fascinating Majestic Programmable Evangelical Guru


More information about the ffmpeg-devel mailing list