[FFmpeg-devel] [PATCH 1/2] lavu/opt: add AV_OPT_TYPE_DURATION.

Stefano Sabatini stefasab at gmail.com
Mon Mar 18 22:20:07 CET 2013


On date Sunday 2013-03-17 21:31:08 +0100, Nicolas George encoded:
> Le septidi 27 ventôse, an CCXXI, Ronald S. Bultje a écrit :
> > So why is it called duration? I don't see anything that is
> > duration-specific in this description. Don't you mean "time"?
> 
> It corresponds to this:
> 
>  * @param duration flag which tells how to interpret timestr, if not
>  * zero timestr is interpreted as a duration, otherwise as a date
>  * @return 0 in case of success, a negative value corresponding to an
>  * AVERROR code otherwise
>  */
> int av_parse_time(int64_t *timeval, const char *timestr, int duration);
> 

> This patch uses duration=1 when calling av_parse_time(). Maybe at some point
> adding AV_OPT_TYPE_DATE or _TIME may be useful, but I had not yet
> encountered the need.

AV_OPT_TYPE_TIME is fine as well, provided that "time" is not meant as
"date", AV_OPT_TYPE_DURATION is IMO acceptable so I let the
contributor to decide.

Probably:
int av_parse_time(int64_t *timeval, const char *timestr, int is_date);

was a better choice, but it is too late to change it (and changing the
API for that would be rather overkill at this point).
-- 
FFmpeg = Freak & Faithless Monstrous Patchable Egregious Game


More information about the ffmpeg-devel mailing list