From dc00b146c487f71ef1f0a23a4f2b9948b2fac18b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 Jul 2014 15:04:46 +0200 Subject: player: remove the last instances of polling Mouse cursor handling, --heartbeat-cmd, and OSD messages basically relied on polling. For this reason, the playloop always used a small timeout (not more than 500ms). Fix these cases, and raise the timeout to 100 seconds. There is no reason behind this number; for this specific purpose it's as close to infinity as any other number. On MS Windows, or if vo_sdl is used, the timeout remains very small. In these cases the GUI code doesn't do proper event handling in the first place, and fixing it requires much more effort. getch2_poll() still does polling, because as far as I'm aware no event- based way to detect this state change exists. --- player/core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'player/core.h') diff --git a/player/core.h b/player/core.h index 039f5c26cb..01fefd0889 100644 --- a/player/core.h +++ b/player/core.h @@ -291,9 +291,11 @@ typedef struct MPContext { double audio_delay; - double last_heartbeat; + double next_heartbeat; double last_idle_tick; + double sleeptime; // number of seconds to sleep before next iteration + double mouse_timer; unsigned int mouse_event_ts; bool mouse_cursor_visible; -- cgit v1.2.3