summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2012-12-19 12:58:52 +0100
committerRudolf Polzer <divverent@xonotic.org>2012-12-19 12:58:52 +0100
commit7d0a20954f4ad642901a65fcb39ab601032ddcea (patch)
tree5699e70be76ec3f5ba2cc49faed378a3034601a7 /video
parent51c98619c8d039b4cf459910a3a934637cb69e05 (diff)
downloadmpv-7d0a20954f4ad642901a65fcb39ab601032ddcea.tar.bz2
mpv-7d0a20954f4ad642901a65fcb39ab601032ddcea.tar.xz
core: make WAKEUP_PERIOD overridable by the vo
This is better than having just the operating system type decide the wakeup period, as e.g. when compiling for Win32/cygwin, a wakeup period of 0.5 would work perfectly fine. Instead, the default wakeup period is now only decided by availability of a working select() system call (which is the case on cygwin but not mingw and MSVC) AND a vo that can provide an event file descriptor or a similar hack (vo_corevideo). vos that cannot do either need polling for event handling and now can set the wakeup period to 0.02 in the vo code.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.h1
-rw-r--r--video/out/w32_common.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 22e4650bde..452d50d548 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -241,6 +241,7 @@ struct vo {
bool want_redraw; // visible frame wrong (window resize), needs refresh
bool redrawing; // between redrawing frame and flipping it
bool hasframe; // >= 1 frame has been drawn, so redraw is possible
+ double wakeup_period; // if > 0, this sets the maximum wakeup period for event polling
double flip_queue_offset; // queue flip events at most this much in advance
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index ab608f5d8d..113ca2dddd 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -666,6 +666,9 @@ int vo_w32_init(struct vo *vo)
if (WinID >= 0)
EnableWindow(w32->window, 0);
+ // we don't have proper event handling
+ vo->wakeup_period = 0.02;
+
updateScreenProperties(vo);
mp_msg(MSGT_VO, MSGL_V, "vo: win32: running at %dx%d with depth %d\n",