[FFmpeg-devel] [PATCH v4 3/7] cmdutils: use new iteration APIs

Nicolas George george at nsup.org
Thu Mar 22 12:29:31 EET 2018


Josh de Kock (2018-03-22):
>  I have -ffunroll'd the macros for you Nicolas.

That is not what I asked. The macros were just a way of making the poor
API a little less poor, but the problem still remains:

> +#ifdef CONFIG_AVDEVICE
> +        opaque = 0;
> +        if (muxdemuxers != SHOW_DEMUXERS) {
> +            while ((ofmt = av_outdev_iterate(&opaque))) {
> +                if ((!name || strcmp(ofmt-> name, name) < 0) && strcmp(ofmt-> name, last_name) > 0) {
> +                    name = ofmt - > name;
> +                    long_name = ofmt - > long_name;
> +                    is_ofmt = 1;
>                  }
> -                if (name && strcmp(ifmt->name, name) == 0)
> -                    decode = 1;
>              }
>          }
> +
> +        opaque = 0;
> +        if (muxdemuxers != SHOW_MUXERS) {
> +            while ((ifmt = av_indev_iterate(&opaque))) {
> +                if ((!name || strcmp(ifmt-> name, name) < 0) && strcmp(ifmt-> name, last_name) > 0) {
> +                    name = ifmt - > name;
> +                    long_name = ifmt - > long_name;
> +                    is_ifmt = 1;
> +                }
> +            }
> +        }
> +#endif

There is a separate loop for devices, and I strongly oppose to that. Fix
your API so that all (de)muxer-like components are returned in a single
loop.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180322/cfbe428c/attachment.sig>


More information about the ffmpeg-devel mailing list