On 21.12.2014, at 21:09, Michael Niedermayer <michae...@gmx.at> wrote:
> +    int j;
> +
> +    for (j = i = 1; i<argc; i++) {
> +        if (av_isdigit(argv[i][0])) {
> +            if (j++ == 1) {
> +                retry_count = atoi(argv[i]);
> +            } else
> +                max_size = atoi(argv[i]);
> +        } else {
> +            single_format = argv[i];
> +        }
> +    }

I'm not sure it is worth spending much effort on, but it is messy.
For example it will silently accept multiple non-integers and overwrite 
single_format.
Also strtol would be nicer than atoi which does no checking (related insofar as 
it would be an alternative to isdigit).
But maybe it would be best to simply check av_isdigit(argv[1][0]) and based on 
that go into the one or the other path, no loops or anything and allowing any 
arbitrary order...
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to