From fe782a6e957c1f2d472a91eceef01ca5fd6f5cb7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 16 Aug 2014 21:43:13 +0200 Subject: 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. --- video/out/vo_vdpau.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'video/out/vo_vdpau.c') 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"); -- cgit v1.2.3