[FFmpeg-devel] [PATCH] cmdutils: make parse_options() accept a parse_arg_function with generic signature

Michael Niedermayer michaelni at gmx.at
Sun Jan 22 06:55:36 CET 2012


On Sat, Jan 21, 2012 at 11:53:48PM +0100, Stefano Sabatini wrote:
> On date Sunday 2012-01-15 11:37:53 +0100, Stefano Sabatini encoded:
> > On date Thursday 2012-01-12 18:25:27 +0100, Stefano Sabatini encoded:
> > > Make parse_options() accept a parse_arg_function with signature:
> > > int (* parse_arg_function)(void *optctx, const char *, const char*)
> > > rather than:
> > > int (* parse_arg_function)(void *optctx, const char*)
> > > 
> > > This is required as this function may be used for other options as well,
> > > as in the case of the ffplay and ffprobe -i options.
> > > 
> > > In particular, fix ffprobe -i FILE behavior.
> > > ---
> > >  avconv.c   |    3 ++-
> > >  cmdutils.c |    4 ++--
> > >  cmdutils.h |    2 +-
> > >  ffmpeg.c   |    3 ++-
> > >  ffplay.c   |    9 ++++-----
> > >  ffprobe.c  |    7 ++++---
> > >  6 files changed, 15 insertions(+), 13 deletions(-)
> > 
> > Updated, with bonus patch.
> 
> Ping (note: currently ffprobe -i FILE is borken).

Why not use the same solution as ffplay -i uses ?

[...]
-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120122/aaff350c/attachment.asc>


More information about the ffmpeg-devel mailing list