[FFmpeg-devel] [PATCH] parseutils: ignore digits below the microsecond.

Michael Niedermayer michaelni at gmx.at
Tue Jul 10 22:21:55 CEST 2012


On Tue, Jul 10, 2012 at 07:14:15PM +0200, Nicolas George wrote:
> Accept 1.1234567 as simply 1.123456 instead of rejecting it.
> The rounding is towards 0, which is acceptable and much simpler.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavutil/parseutils.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> index 795236c..22c45db 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -610,6 +610,8 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
>                  break;
>              microseconds += n * (*q - '0');
>          }
> +        while (isdigit(*q))
> +            q++;
>      }

LGTM

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20120710/e3e335ce/attachment.asc>


More information about the ffmpeg-devel mailing list