[FFmpeg-devel] [PATCH] ffprobe: move writer context registration and initialization in main()
Clément Bœsch
ubitux at gmail.com
Fri Jan 6 20:34:31 CET 2012
On Fri, Jan 06, 2012 at 07:15:33PM +0100, Stefano Sabatini wrote:
> On date Friday 2012-01-06 11:05:15 +0100, Stefano Sabatini encoded:
> > Simplify pending changes, as the writer context will be used in the
> > main() routine.
> > ---
> > ffprobe.c | 53 ++++++++++++++++++++++++++---------------------------
> > 1 files changed, 26 insertions(+), 27 deletions(-)
>
> Updated, slightly different.
> --
> FFmpeg = Freak and Furious Majestic Practical Ecstatic Gorilla
> 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.
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120106/be0db78e/attachment.asc>
More information about the ffmpeg-devel
mailing list