summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-12 22:31:22 +0200
committerwm4 <wm4@nowhere>2015-05-12 22:42:06 +0200
commit29eb764fe0ae67bebfa930f88a9d7088f30561dd (patch)
tree9aa78e0b847a4d00f46077a73f453da16c8f7e2a /video/out/cocoa_common.m
parent7735b297329ed730f410b0b3cb6503eeea04ee90 (diff)
downloadmpv-29eb764fe0ae67bebfa930f88a9d7088f30561dd.tar.bz2
mpv-29eb764fe0ae67bebfa930f88a9d7088f30561dd.tar.xz
cocoa: make live-resizing as fast as before
Interrupt video timing. This means the Cocoa event loop does not have to up to 2 video frame durations until redrawing the frame finally has finished. We abuse the VO event flags for this. Eventually this should use wait_vo() or so in the video timing wait function, but for now the interaction this would require with the code of other VOs/backends would cause too much of a mess.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 686a064eb9..b9209bd143 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -629,13 +629,15 @@ static void vo_cocoa_resize_redraw(struct vo *vo, int width, int height)
s->frame_w = s->frame_h = 0;
s->pending_events |= VO_EVENT_RESIZE | VO_EVENT_EXPOSE;
- vo_wakeup(vo);
+ vo_event(vo, VO_EVENT_LIVE_RESIZING);
while (s->frame_w != width && s->frame_h != height && s->vo_ready) {
if (pthread_cond_timedwait(&s->resize_wakeup, &s->resize_lock, &e))
break;
}
+ vo_query_and_reset_events(vo, VO_EVENT_LIVE_RESIZING);
+
pthread_mutex_unlock(&s->resize_lock);
}