[FFmpeg-devel] [PATCH] ffserver: deprecate inconsistent parsing behavior of Truncate option

Stefano Sabatini stefasab at gmail.com
Fri Nov 29 10:30:44 CET 2013


On date Friday 2013-11-29 10:25:12 +0100, Clément Bœsch encoded:
> On Thu, Nov 28, 2013 at 10:50:48PM +0100, Stefano Sabatini wrote:
> > Also make it accept the more consistent behavior (boolean option set to
> > true when specified).
> > ---
> >  ffserver.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/ffserver.c b/ffserver.c
> > index cd66778..22fd453 100644
> > --- a/ffserver.c
> > +++ b/ffserver.c
> > @@ -4232,7 +4232,15 @@ static int parse_ffconfig(const char *filename)
> >          } else if (!av_strcasecmp(cmd, "Truncate")) {
> >              if (feed) {
> >                  get_arg(arg, sizeof(arg), &p);
> > -                feed->truncate = strtod(arg, NULL);
> > +                /* assume Truncate is true in case no argument is specified */
> > +                if (!arg[0]) {
> > +                    feed->truncate = 1;
> > +                } else {
> > +                    av_log(NULL, AV_LOG_WARNING,
> > +                           "Truncate N syntax in configuration file is deprecated, "
> > +                           "use Truncate alone with no arguments\n");
> 
> > +                    feed->truncate = strtod(arg, NULL);
> 
> I know it was there but using a floating point function reader for an int
> value is kind of strange.
> 
> Should be OK anyway.

Applied.
-- 
FFmpeg = Fundamental & Forgiving Mortal Powerful Exuberant Geisha


More information about the ffmpeg-devel mailing list