[FFmpeg-devel] [PATCH] ffprobe: move writer context registration and initialization in main()

Stefano Sabatini stefasab at gmail.com
Sat Jan 7 11:10:05 CET 2012


On date Friday 2012-01-06 21:09:31 +0100, Stefano Sabatini encoded:
> On date Friday 2012-01-06 20:34:31 +0100, Clément Bœsch encoded:
[...]
> > > From b7225527fa60d48792c508c645661cc101c0fd61 Mon Sep 17 00:00:00 2001
> > > From: Stefano Sabatini <stefasab at gmail.com>
> > > Date: Sun, 1 Jan 2012 17:18:18 +0100
> > > Subject: [PATCH] ffprobe: move writer context registration and initialization
> > >  in main()
> > > 
> > > Simplify pending changes, as the writer context will be used in the
> > > main() routine.
> > > ---
> > >  ffprobe.c |   62 +++++++++++++++++++++++++++++-------------------------------
> > >  1 files changed, 30 insertions(+), 32 deletions(-)
> > > 
> > > diff --git a/ffprobe.c b/ffprobe.c
> > > index 34626a8..dabbbc5 100644
> > > --- a/ffprobe.c
> > > +++ b/ffprobe.c
> > [...]
> > >  
> > > -    ret = probe_file(input_filename);
> > > +    if ((ret = writer_open(&wctx, w, w_args, NULL)) >= 0) {
> > > +        if (!input_filename) {
> > > +            show_usage();
> > > +            av_log(NULL, AV_LOG_ERROR, "You have to specify one input file.\n");
> > > +            av_log(NULL, AV_LOG_ERROR, "Use -h to get full help or, even better, run 'man %s'.\n", program_name);
> > > +            ret = AVERROR(EINVAL);
> > > +        } else
> > > +            ret = probe_file(wctx, input_filename);
> > > +
> > > +        writer_close(&wctx);
> > > +    }
> > >  
> > 
> > The reasons it tries to open the writer before it actually checks if the
> > user has specified an input don't sound obvious to me. But the patch LGTM
> > anyway.
> 
> This is implicitely required by -show_version, you may want to print
> the version info even if no file was specified, for example with:
> ffprobe -show_version

Applied.
-- 
FFmpeg = Forgiving & Fabulous Mind-dumbing Peaceful Eager Guru


More information about the ffmpeg-devel mailing list