summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Zetterberg <jozz@jozz.se>2014-02-02 11:07:08 +0000
committerwm4 <wm4@nowhere>2014-02-10 22:10:54 +0100
commitc60c784a6af4b7fc035a8015c1d14febf8ecb83c (patch)
tree1d19bc7b0cc0793dcce26dcefbcddad890411745
parentbbdc47ee80beb5b710c9ad1deb48b1a20f45d42c (diff)
downloadmpv-c60c784a6af4b7fc035a8015c1d14febf8ecb83c.tar.bz2
mpv-c60c784a6af4b7fc035a8015c1d14febf8ecb83c.tar.xz
vo_vdpau: Ensure presentation time is within bounds
When a time sync happens the last sync time is the minimum time that can be used for presentation.
-rw-r--r--video/out/vo_vdpau.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 0385d0505a..5acd3f9530 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1061,6 +1061,10 @@ static void flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
if (vc->vsync_interval == 1)
duration = -1; // Make sure drop logic is disabled
+ /* If the presentation time may not be before our last timestamp sync. */
+ if (pts_us && pts_us < vc->last_sync_update)
+ pts_us = vc->last_sync_update;
+
uint64_t now = sync_vdptime(vo);
uint64_t pts = pts_us ? convert_to_vdptime(vo, pts_us) : now;
uint64_t ideal_pts = pts;