diff options
author | wm4 <wm4@nowhere> | 2013-05-25 18:31:06 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-26 16:44:20 +0200 |
commit | e56d8a200d900066c3da571d92733f66ce6a13ab (patch) | |
tree | f43862ec12beee05380da82ebef23bcce83401e7 /video/out/vo.h | |
parent | 51254a678c386cf48f2caa51e06ad34065c8693a (diff) | |
download | mpv-e56d8a200d900066c3da571d92733f66ce6a13ab.tar.bz2 mpv-e56d8a200d900066c3da571d92733f66ce6a13ab.tar.xz |
Replace all calls to GetTimer()/GetTimerMS()
GetTimer() is generally replaced with mp_time_us(). Both calls return
microseconds, but the latter uses int64_t, us defined to never wrap,
and never returns 0 or negative values.
GetTimerMS() has no direct replacement. Instead the other functions are
used.
For some code, switch to mp_time_sec(), which returns the time as double
float value in seconds. The returned time is offset to program start
time, so there is enough precision left to deliver microsecond
resolution for at least 100 years. Unless it's casted to a float
(or the CPU reduces precision), which is why we still use mp_time_us()
out of paranoia in places where precision is clearly needed.
Always switch to the correct time. The whole point of the new timer
calls is that they don't wrap, and storing microseconds in unsigned int
variables would negate this.
In some cases, remove wrap-around handling for time values.
Diffstat (limited to 'video/out/vo.h')
-rw-r--r-- | video/out/vo.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/vo.h b/video/out/vo.h index f357b21797..3dcc58b6c3 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -195,9 +195,13 @@ struct vo_driver { /* * Blit/Flip buffer to the screen. Must be called after each frame! + * pts_us is the frame presentation time, linked to mp_time_us(). + * pts_us is 0 if the frame should be presented immediately. + * duration is estimated time in us until the next frame is shown. + * duration is -1 if it is unknown or unset. */ void (*flip_page)(struct vo *vo); - void (*flip_page_timed)(struct vo *vo, unsigned int pts_us, int duration); + void (*flip_page_timed)(struct vo *vo, int64_t pts_us, int duration); /* * Closes driver. Should restore the original state of the system. |