From ca893689fefdac74338b41aa21fbc601ae102ff6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 2 Mar 2013 22:50:09 +0100 Subject: 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. --- core/mplayer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core') 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 ==================== -- cgit v1.2.3