[FFmpeg-devel] [PATCH] Make parse_date return INT64_MIN in case of unparsable input

Stefano Sabatini stefano.sabatini-lala
Thu Sep 13 14:02:48 CEST 2007


On date Wednesday 2007-09-12 18:01:25 +0200, Michael Niedermayer encoded:
[...]
> > Suggested log: $subject.
> > 
> > If you're OK I can also eventually apply the second proposed solution,
> > that is to deprecate parse_date in favour of a function like:
> > int av_parse_date (int64_t *us, char *timestr, int is_duration) 
> > 
> > which is imho cleaner (yes I know, I'm risking to be flamed here ;-)).
> 
> [...]
> > Index: libavformat/utils.c
> > ===================================================================
> > --- libavformat/utils.c	(revision 10474)
> > +++ libavformat/utils.c	(working copy)
> > @@ -2621,10 +2621,7 @@
> >  
> >      /* Now we have all the fields that we can get */
> >      if (!q) {
> > -        if (duration)
> > -            return 0;
> > -        else
> > -            return now * INT64_C(1000000);
> > +        return INT64_MIN;
> >      }
> >  
> >      if (duration) {
> 
> ok if it doesnt break anything

I just noticed that it fails wherever the error condition is raised
and isn't handled, that is everywhere the function is actually used
(in every ff*).

So the patch as it is is *not* OK.

Sorry for the noise. 

Regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)




More information about the ffmpeg-devel mailing list