[FFmpeg-devel] [PATCH 3/3] parseutils: add av_parse_time() test.

Nicolas George nicolas.george at normalesup.org
Mon Apr 23 00:49:28 CEST 2012


Le quintidi 5 floréal, an CCXX, Stefano Sabatini a écrit :
> According to docs:
>  * - If a duration the syntax is:
>  * @code
>  * [-]HH[:MM[:SS[.m...]]]
>  * [-]S+[.m...]
> 
> which is ambiguous since 42 may mean either 42 hours or 42
> seconds. You may interpret 12:34 like 12 hours and 34 minutes because
> of the presence of ":", in each case the documentation should be fixed
> (not in this patch of course).

Indeed. Currently, "12:34" is parsed as 12 seconds, and the ":34" is
silently ignored. I am sure you agree that it is not good at all.

I will propose a patch for the documentation to mention that only full
HH:MM:SS is supported. Adding support for a shorthand (I believe MM:SS is
more useful for a duration) can be done on top of that.

> (BTW I have a pending patch for extending the syntax so that may be
> written as "12h34m", which is a bit more readable/less ambiguous).

Good idea.

Regards,

-- 
  Nicolas George
-------------- 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/20120423/f4530bda/attachment.asc>


More information about the ffmpeg-devel mailing list