summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-16 00:05:02 +0200
committerwm4 <wm4@nowhere>2014-08-16 00:05:02 +0200
commit4f984b987c323b63db9e4926da8f6265f841a6ca (patch)
tree76db26ac39918a25fbd3bf4d9602123de430df47 /video
parent07aba86b37887c0aef7ea90af250fcf19062369b (diff)
downloadmpv-4f984b987c323b63db9e4926da8f6265f841a6ca.tar.bz2
mpv-4f984b987c323b63db9e4926da8f6265f841a6ca.tar.xz
video: add --display-fps switch to control framedrop FPS
Since the display FPS is currently detected on X11 only (and even there it's known to be wrong on certain setups), it seems like a good idea to make this user-configurable.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 72f98e8859..bb98160883 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -332,8 +332,12 @@ static void run_reconfig(void *p)
forget_frames(vo); // implicitly synchronized
double display_fps = 1000.0; // assume infinite if unset
- vo->driver->control(vo, VOCTRL_GET_DISPLAY_FPS, &display_fps);
- vo->in->vsync_interval = 1e6 / display_fps;
+ if (vo->global->opts->frame_drop_fps > 0) {
+ display_fps = vo->global->opts->frame_drop_fps;
+ } else {
+ vo->driver->control(vo, VOCTRL_GET_DISPLAY_FPS, &display_fps);
+ }
+ vo->in->vsync_interval = MPMAX((int64_t)(1e6 / display_fps), 1);
MP_VERBOSE(vo, "Assuming %f FPS for framedrop.\n", display_fps);
}
@@ -515,7 +519,7 @@ static int64_t prev_sync(struct vo *vo, int64_t ts)
struct vo_internal *in = vo->in;
int64_t diff = (int64_t)(ts - in->last_flip);
- int64_t offset = diff % MPMAX(in->vsync_interval, 1);
+ int64_t offset = diff % in->vsync_interval;
if (offset < 0)
offset += in->vsync_interval;
return ts - offset;