[FFmpeg-devel] [PATCH] tools/probetest: support testing a single specified input format

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Dec 21 22:36:10 CET 2014


On 21.12.2014, at 21:09, Michael Niedermayer <michaelni at 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...


More information about the ffmpeg-devel mailing list