diff options
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r-- | libvo/x11_common.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index a9de90d350..621880e137 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1642,6 +1642,18 @@ void vo_vm_close(struct vo *vo) vidmodes = NULL; } } + +double vo_vm_get_fps(struct vo *vo) +{ + struct vo_x11_state *x11 = vo->x11; + int clock; + XF86VidModeModeLine modeline; + if (!XF86VidModeGetModeLine(x11->display, x11->screen, &clock, &modeline)) + return 0; + if (modeline.privsize) + Xfree(modeline.private); + return 1e3 * clock / modeline.htotal / modeline.vtotal; +} #endif #endif /* X11_FULLSCREEN */ |