summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-16 21:43:13 +0200
committerwm4 <wm4@nowhere>2014-08-16 21:56:22 +0200
commitfe782a6e957c1f2d472a91eceef01ca5fd6f5cb7 (patch)
tree2007e80bdf53da8aab97be0bd4e0479fbd202695 /video/out/vo_vdpau.c
parent925c431ff7f68a7ea8b1fc0cd260edcf8b88fdc1 (diff)
downloadmpv-fe782a6e957c1f2d472a91eceef01ca5fd6f5cb7.tar.bz2
mpv-fe782a6e957c1f2d472a91eceef01ca5fd6f5cb7.tar.xz
x11: use xrandr to retrieve display refresh rate
Drop use of the ancient XF86VM, and use the slightly less ancient Xrandr extension to retrieve the refresh rate. Xrandr has the advantage that it supports multiple monitors (at least the modern version of it). For now, we don't attempt any dynamic reconfiguration. We don't request and listen to Xrandr events, and we don't notify the VO code of changes in the refresh rate. (The later works by assuming that X coordinates map directly to Xrandr coordinates, which probably is wrong with compositing window manager, at least if these use complicated transformations. But I know of no API to handle this.) It would be nice to drop use of the Xinerama extension too, but unfortunately, at least one EWMH feature uses Xinerama screen numbers, and I don't know how that maps to Xrandr outputs.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index e3498be1d1..6699e1b906 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -338,9 +338,8 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo)
MP_INFO(vo, "Assuming user-specified display refresh rate of %.3f Hz.\n",
vc->user_fps);
} else if (vc->user_fps == 0) {
-#if HAVE_XF86VM
double fps = vo_x11_vm_get_fps(vo);
- if (!fps)
+ if (fps < 1)
MP_WARN(vo, "Failed to get display FPS\n");
else {
vc->vsync_interval = 1e9 / fps;
@@ -349,11 +348,6 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo)
MP_INFO(vo, "If that value looks wrong give the "
"-vo vdpau:fps=X suboption manually.\n");
}
-#else
- MP_INFO(vo, "This binary has been compiled without XF86VidMode support.\n");
- MP_INFO(vo, "Can't use vsync-aware timing without manually provided "
- "-vo vdpau:fps=X suboption.\n");
-#endif
} else
MP_VERBOSE(vo, "framedrop/timing logic disabled by user.\n");