From c60c784a6af4b7fc035a8015c1d14febf8ecb83c Mon Sep 17 00:00:00 2001 From: Jonas Zetterberg Date: Sun, 2 Feb 2014 11:07:08 +0000 Subject: 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. --- video/out/vo_vdpau.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3