[FFmpeg-devel] [PATCH] Enhace documentation for libavformat/utils.c:parse_date

Michael Niedermayer michaelni
Wed Sep 12 13:24:10 CEST 2007


Hi

On Wed, Sep 12, 2007 at 12:32:12PM +0200, Stefano Sabatini wrote:
> On date Wednesday 2007-09-12 12:00:50 +0200, Michael Niedermayer encoded:
> > Hi
> > 
> > On Wed, Sep 12, 2007 at 11:13:24AM +0200, Stefano Sabatini wrote:
> > [...]
> > > + * Returns the number of microseconds since 1st of January, 1970 up
> > > + * to the time of the parsed date or up to the current time if \p
> > > + * datestr cannot be successfully parsed.
> > 
> > i do not think that this is the intended behavior but rather a "bug"
> > in the implementation thus you change the API by hardcoding the bug in
> > it and would need to bump the respective versions but i wont accept that
> 
> Got the point.
>  
> > using the current date in case a string cannot be parsed is a very odd
> > way to handle an error
> 
> Completely agree. 
> 
> Possible solutions:
> 
> 1. make parse_date return a negative number in case of error (what
> happens if the date parsed is before 1970-01-01?)

return INT64_MIN for an error, that wont collide with pre 1970 dates


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- 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/20070912/933cd52d/attachment.pgp>



More information about the ffmpeg-devel mailing list