On Sat, Oct 18, 2014 at 08:25:30PM +0200, Lukasz Marek wrote: > Allows to list sources/sinks of the devices that implement > that functionality. > > Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com> > --- > cmdutils.c | 191 > +++++++++++++++++++++++++++++++++++++++++++++++++ > cmdutils.h | 12 ++++ > cmdutils_common_opts.h | 6 ++ > 3 files changed, 209 insertions(+) [...] > +int show_sources(void *optctx, const char *opt, const char *arg) > +{ > +#if CONFIG_AVDEVICE > + AVInputFormat *fmt = NULL; > + char *dev = NULL; > + AVDictionary *opts = NULL; > + int ret = 0; > + int error_level = av_log_get_level(); > + > + av_log_set_level(AV_LOG_ERROR); > + > + if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) > + 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 && strcmp(fmt->name, dev)) > + continue; > + print_device_sources(fmt, opts); > + } > + } while (fmt); > + do { > + fmt = av_input_video_device_next(fmt); > + if (fmt) { > + if (dev && strcmp(fmt->name, dev)) > + continue; > + print_device_sources(fmt, opts); > + } > + } while (fmt); > + fail: > + av_dict_free(&opts); > + av_free(dev); > + av_log_set_level(error_level); > + return ret; > +#else > + printf("Configured without libavdevice\n"); > + return AVERROR(ENOSYS); > +#endif
it seems the only use of this function is under #if CONFIG_AVDEVICE so the fallback shouldnt be needed same for the other function also mising documentation and example in docs [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel