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

Michael Niedermayer michaelni at gmx.at
Mon Dec 22 00:45:21 CET 2014


On Sun, Dec 21, 2014 at 10:36:10PM +0100, Reimar Döffinger wrote:
> 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...


not so hacky solution posted


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141222/4e166267/attachment.asc>


More information about the ffmpeg-devel mailing list