[FFmpeg-devel] [PATCH 1/6 v2] lavu: add av_gettime_relative()

Olivier Langlois olivier at trillion01.com
Tue May 13 21:31:04 CEST 2014


On Tue, 2014-05-13 at 15:23 -0400, Olivier Langlois wrote:
> On Tue, 2014-05-13 at 20:58 +0200, Reimar Döffinger wrote:
> > On Mon, May 12, 2014 at 04:26:37PM -0400, Olivier Langlois wrote:
> > > It is very easy to experience the issues that this patch attempt to address
> > > by rewinding back in the past the system time while ffmpeg is running.
> > > 
> > > this is breaking the ffmpeg report printing (ffmepg.c:print_report()) and
> > > the the rate emulator functionality (-re) without the patch.
> > 
> > I still think these should be fixed to not be so brittle and handle
> > strange clock values more gracefully.
> 
> These are fixed and rock solid on platforms supporting
> POSIX_CLOCK_MONOTONIC (Linux, maybe macos) with part 2/6 of this patch:
> 
> https://ffmpeg.org/pipermail/ffmpeg-devel/2014-May/157346.html
> 
> If possible, someone could adapt av_gettime_relative() implementation to
> make it monotonic on Windows or some other platforms as well.
> 
How about making these 2 ffmpeg features more robust even on platforms
where av_gettime_relative() is not monotonic?

This could be done by using for the first time the new function
av_gettime_relative_is_monotonic() and comparing that the second time is
greater or equal before performing the substraction.

If you think that this could be a good idea, I do not mind revisiting
part 2/6 of my patch to add this improvement.




More information about the ffmpeg-devel mailing list