[FFmpeg-devel] [PATCH] Allow MM:SS format for duration

Stefano Sabatini stefasab at gmail.com
Wed Feb 20 15:54:53 CET 2013


On date Wednesday 2013-02-20 09:57:58 +0530, Senthilnathan Maadasamy encoded:
> Fixes ticket 2258
> 
> Signed-off-by: Senthilnathan M <senthilnathan.maadasamy at gmail.com>
> ---
>  libavutil/parseutils.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> index 73e400a..c67f971 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -588,6 +588,11 @@ int av_parse_time(int64_t *timeval, const char
> *timestr, int duration)
>          /* parse timestr as HH:MM:SS */
>          q = av_small_strptime(p, "%J:%M:%S", &dt);
>          if (!q) {
> +            /* parse timestr as MM:SS */
> +            q = av_small_strptime(p, "%M:%S", &dt);
> +            dt.tm_hour = 0;
> +        }
> +        if (!q) {
>              /* parse timestr as S+ */
>              dt.tm_sec = strtol(p, (void *)&q, 10);
>              if (q == p) /* the parsing didn't succeed */

Looks reasonable.

Please also update documenation in doc/syntax.texi and in the function
doxy.
-- 
FFmpeg = Funny and Free Merciful Puristic Extensive Geisha


More information about the ffmpeg-devel mailing list