summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-02 22:50:09 +0100
committerwm4 <wm4@nowhere>2013-03-03 15:36:56 +0100
commitca893689fefdac74338b41aa21fbc601ae102ff6 (patch)
treedfab3405dffcf5327e8f624e7205bb36e3a066d4 /core
parent9efe32120b4d5aaa88eccf4767fa7d7c5c700fd1 (diff)
downloadmpv-ca893689fefdac74338b41aa21fbc601ae102ff6.tar.bz2
mpv-ca893689fefdac74338b41aa21fbc601ae102ff6.tar.xz
x11_common: fix --cursor-autohide when paused
When paused, --cursor-autohide worked with a precision of 500ms, which is the main loop's default sleep time when paused. Cursor hiding is polled in x11_common, and the main loop never called the X11 code at the right time. Fix this by allowing the VO to set a time when it should be called next.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 6e0256fbaa..a4c9c09960 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3471,8 +3471,14 @@ static void run_playloop(struct MPContext *mpctx)
}
}
}
- if (sleeptime > 0)
- mp_input_get_cmd(mpctx->input, sleeptime * 1000, true);
+ if (sleeptime > 0) {
+ int sleep_ms = sleeptime * 1000;
+ if (mpctx->sh_video) {
+ unsigned int vo_sleep = vo_get_sleep_time(mpctx->video_out);
+ sleep_ms = FFMIN(sleep_ms, vo_sleep);
+ }
+ mp_input_get_cmd(mpctx->input, sleep_ms, true);
+ }
}
//================= Keyboard events, SEEKing ====================