summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-27 16:17:46 +0100
committerwm4 <wm4@nowhere>2014-10-27 16:17:55 +0100
commitfcc360ccad4d611609c098db004cfbd58c8cd895 (patch)
tree6b0bb2341d374e59da71327693a4731a978c086b /video
parenta95ce07273a7ee4b0f8db0d5de236d9708ddcd0d (diff)
downloadmpv-fcc360ccad4d611609c098db004cfbd58c8cd895.tar.bz2
mpv-fcc360ccad4d611609c098db004cfbd58c8cd895.tar.xz
x11: fix display FPS detection for interlaced modes
In interlaced modes, we output fields, not complete frames, so the framerate doubles. The method to calculate this was borrowed from xrandr code. Hopefully fixes #1224.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 0ce669df6f..04f475ec5f 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -365,10 +365,15 @@ static void xrandr_read(struct vo_x11_state *x11)
continue;
if (x11->num_displays >= MAX_DISPLAYS)
continue;
+ double vTotal = m.vTotal;
+ if (m.modeFlags & RR_DoubleScan)
+ vTotal *= 2;
+ if (m.modeFlags & RR_Interlace)
+ vTotal /= 2;
struct xrandr_display d = {
.rc = { crtc->x, crtc->y,
crtc->x + crtc->width, crtc->y + crtc->height },
- .fps = m.dotClock / (m.hTotal * (double)m.vTotal),
+ .fps = m.dotClock / (m.hTotal * vTotal),
};
int num = x11->num_displays++;
MP_VERBOSE(x11, "Display %d: [%d, %d, %d, %d] @ %f FPS\n",