From 417e256c215e555198db1796edec3cfafd044459 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Aug 2015 19:23:07 +0200 Subject: vo_vdpau: fix frame scheduling if display FPS is unknown Pretty stupid: vo_get_vsync_interval() returns a negative value if the display FPS is unknown (e.g. xrandr not compiled), and the comparison whether the value is below 0 fails later because it's assigned to an unsigned int. Regression since commit e3d85ad4. Also, fix some comments in vo.c. --- video/out/vo.c | 4 ++-- video/out/vo_vdpau.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/video/out/vo.c b/video/out/vo.c index a0c4768b68..9960004e67 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -135,6 +135,8 @@ struct vo_internal { int queued_events; // event mask for the user int internal_events; // event mask for us + int64_t vsync_interval; + int64_t flip_queue_offset; // queue flip events at most this much in advance int64_t drop_count; @@ -151,7 +153,6 @@ struct vo_internal { double display_fps; // --- The following fields can be accessed from the VO thread only - int64_t vsync_interval; int64_t vsync_interval_approx; int64_t last_flip; char *window_title; @@ -981,7 +982,6 @@ int vo_get_num_req_frames(struct vo *vo) return res; } -// to be called from the VO thread only int64_t vo_get_vsync_interval(struct vo *vo) { struct vo_internal *in = vo->in; diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 7e7771f209..20457b602e 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -110,7 +110,7 @@ struct vdpctx { VdpTime recent_vsync_time; float user_fps; int composite_detect; - unsigned int vsync_interval; + int vsync_interval; uint64_t last_queue_time; uint64_t queue_time[MAX_OUTPUT_SURFACES]; uint64_t last_ideal_time; -- cgit v1.2.3