Message ID | 20201009201811.10710-3-jamrial@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [FFmpeg-devel,1/3] avdevice/alldevices: stop using deprecated linked list API | expand |
Context | Check | Description |
---|---|---|
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
andriy/PPC64_make | warning | Make failed |
James Almer: > Signed-off-by: James Almer <jamrial@gmail.com> > --- > fftools/cmdutils.c | 28 ++++++---------------------- > 1 file changed, 6 insertions(+), 22 deletions(-) > > diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c > index 88fdbeaf1e..83989b8190 100644 > --- a/fftools/cmdutils.c > +++ b/fftools/cmdutils.c > @@ -2302,7 +2302,8 @@ static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionar > > int show_sources(void *optctx, const char *opt, const char *arg) > { > - AVInputFormat *fmt = NULL; > + const AVInputFormat *fmt = NULL; > + void *fmt_iter = NULL; > char *dev = NULL; > AVDictionary *opts = NULL; > int ret = 0; > @@ -2314,17 +2315,7 @@ int show_sources(void *optctx, const char *opt, const char *arg) > goto fail; > > do { > - fmt = av_input_audio_device_next(fmt); > - if (fmt) { > - if (!strcmp(fmt->name, "lavfi")) > - continue; //it's pointless to probe lavfi > - if (dev && !av_match_name(dev, fmt->name)) > - continue; > - print_device_sources(fmt, opts); > - } > - } while (fmt); > - do { > - fmt = av_input_video_device_next(fmt); > + fmt = av_indev_iterate(&fmt_iter); > if (fmt) { > if (dev && !av_match_name(dev, fmt->name)) > continue; > @@ -2340,7 +2331,8 @@ int show_sources(void *optctx, const char *opt, const char *arg) > > int show_sinks(void *optctx, const char *opt, const char *arg) > { > - AVOutputFormat *fmt = NULL; > + const AVInputFormat *fmt = NULL; AVOutputFormat > + void *fmt_iter = NULL; > char *dev = NULL; > AVDictionary *opts = NULL; > int ret = 0; > @@ -2352,15 +2344,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg) > goto fail; > > do { > - fmt = av_output_audio_device_next(fmt); > - if (fmt) { > - if (dev && !av_match_name(dev, fmt->name)) > - continue; > - print_device_sinks(fmt, opts); > - } > - } while (fmt); > - do { > - fmt = av_output_video_device_next(fmt); > + fmt = av_outdev_iterate(&fmt_iter); > if (fmt) { > if (dev && !av_match_name(dev, fmt->name)) > continue; >
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 88fdbeaf1e..83989b8190 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -2302,7 +2302,8 @@ static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionar int show_sources(void *optctx, const char *opt, const char *arg) { - AVInputFormat *fmt = NULL; + const AVInputFormat *fmt = NULL; + void *fmt_iter = NULL; char *dev = NULL; AVDictionary *opts = NULL; int ret = 0; @@ -2314,17 +2315,7 @@ int show_sources(void *optctx, const char *opt, const char *arg) goto fail; do { - fmt = av_input_audio_device_next(fmt); - if (fmt) { - if (!strcmp(fmt->name, "lavfi")) - continue; //it's pointless to probe lavfi - if (dev && !av_match_name(dev, fmt->name)) - continue; - print_device_sources(fmt, opts); - } - } while (fmt); - do { - fmt = av_input_video_device_next(fmt); + fmt = av_indev_iterate(&fmt_iter); if (fmt) { if (dev && !av_match_name(dev, fmt->name)) continue; @@ -2340,7 +2331,8 @@ int show_sources(void *optctx, const char *opt, const char *arg) int show_sinks(void *optctx, const char *opt, const char *arg) { - AVOutputFormat *fmt = NULL; + const AVInputFormat *fmt = NULL; + void *fmt_iter = NULL; char *dev = NULL; AVDictionary *opts = NULL; int ret = 0; @@ -2352,15 +2344,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg) goto fail; do { - fmt = av_output_audio_device_next(fmt); - if (fmt) { - if (dev && !av_match_name(dev, fmt->name)) - continue; - print_device_sinks(fmt, opts); - } - } while (fmt); - do { - fmt = av_output_video_device_next(fmt); + fmt = av_outdev_iterate(&fmt_iter); if (fmt) { if (dev && !av_match_name(dev, fmt->name)) continue;
Signed-off-by: James Almer <jamrial@gmail.com> --- fftools/cmdutils.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-)