[FFmpeg-devel] [PATCH] Make ffserver use parse_options()
Michael Niedermayer
michaelni
Sun May 18 03:11:56 CEST 2008
On Sun, May 18, 2008 at 12:57:10AM +0200, Stefano Sabatini wrote:
> On date Saturday 2008-05-17 23:02:39 +0200, Michael Niedermayer encoded:
> > On Sat, May 17, 2008 at 01:18:20PM +0200, Stefano Sabatini wrote:
> > > Hi all, as in subject,
> > >
> > > somehow improves both the user and the programmer interface of
> > > ffserver.
> > [...]
> > > @@ -4339,10 +4329,45 @@
> > > need_to_start_children = 1;
> > > }
> > >
> > > +static void show_help();
> > > +
> > > +static void opt_show_help(void)
> > > +{
> > > + show_help();
> > > + exit(0);
> > > +}
> > [...]
> > > +static void show_help()
> > > +{
> > > + printf("usage: ffserver [options]\n"
> > > + "Hyper fast multi format Audio/Video streaming server\n");
> > > + printf("\n");
> > > + show_help_options(options, "Main options:\n", 0, 0);
> > > +}
> >
> > Am i missing something or could these 2 be merged?
>
> No, you can indeed do as in the attached patch, though I don't like it
> very much partly because I don't like forward declarations and because
You are sure aware that your code above contains that forward declaration
as well.
> I prefer to define consistently all the opt_* before the options
> array, anyway i reckon this is just pickyness so do as you prefer.
Well then define them all before the array, its not my fault if you do not.
>
> (In ffplay and ffmpeg there is a reason to define two different
> show_help and opt_show_help functions, since the help message is
> printed also in other places not only in opt_show_help.)
Well, at least the help prining for the case of an invalid sync method
in ffplay is very inconsistant. Other invalid parameters do not cause
the help to be printed.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080518/4950e4b8/attachment.pgp>
More information about the ffmpeg-devel
mailing list