[FFmpeg-devel] [PATCH] parseutils: add support for ms and us suffix for AV_OPT_TYPE_DURATION

Aurelien Jacobs aurel at gnuage.org
Fri Mar 2 23:57:27 EET 2018


On Fri, Mar 02, 2018 at 09:39:48PM +0100, Michael Niedermayer wrote:
> On Thu, Mar 01, 2018 at 09:41:20PM +0100, Aurelien Jacobs wrote:
> > supported suffixes are:
> > - s: seconds (default when no suffix specified)
> > - m or ms: milliseconds
> > - u or us: microseconds
> > ---
> >  libavutil/parseutils.c | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> can some of this and the si_prefixes related code in eval.c be
> factored ?

I've had a look at this, but this would increase code complexity
in both eval.c and parseutils.c with no advantage, so I deceided not to.
Anyway, 'u' and 'm' SI prefix are the only ones that make any sense for
AV_OPT_TYPE_DURATION and supporting more prefix than those "thanks" to
common code, might add confusion for end user.

BTW, while looking at si_prefixes, I noticed that both 'k' and 'K' are
supported for meaning "kilo", which is wrong in the SI. Only 'k' is
a prefix for "kilo", 'K' is a unit for "Kelvin".
Not sure if there is actually a good reason for having 'K', if it is
needed for backward compatibility, or if it should be removed...

> either way this LGTM

Great. Applied.


More information about the ffmpeg-devel mailing list