[FFmpeg-devel] [PATCH 3/6] lavf: add new API for iterating muxers and demuxers

wm4 nfxjfg at googlemail.com
Wed Jan 3 17:36:47 EET 2018


On Wed, 3 Jan 2018 00:42:53 +0000
Josh de Kock <josh at itanimul.li> wrote:

> ---
>  configure                |   6 +-
>  doc/APIchanges           |   5 +
>  libavformat/allformats.c | 870 ++++++++++++++++++++++++++++-------------------
>  libavformat/avformat.h   |  31 ++
>  libavformat/format.c     |  56 +--
>  libavformat/version.h    |   3 +
>  6 files changed, 564 insertions(+), 407 deletions(-)

> +    i = 0;
> +    while ((in = (AVInputFormat*)av_demuxer_iterate(&i))) {
> +        if (previn)
> +            previn->next = in;
> +        previn = in;
> +    }

> +    if (previn)
> +        previn->next = NULL;
> +}

(Redundant assignment again?)

> +void av_register_input_format(AVInputFormat *format)
> +{
> +    pthread_once(&av_format_next_init, av_format_init_next);
> +}
> +
> +void av_register_output_format(AVOutputFormat *format)
> +{
> +    pthread_once(&av_format_next_init, av_format_init_next);
>  }

(Same what I said for lavc: should probably just be empty. Or even log
an error message or something.)

Rest LGTM, except that again pthread_once() should be replaced with
ff_thread_once().


More information about the ffmpeg-devel mailing list