Browse Source

VLCVideoUIView: remove displaylink synchronously

VSYNC can easily happens in multiple modules at the same time, and the
CFRunLoop code to avoid deadlock seems to lead this to inversions, so
remove the VSYNC when disabling the window.
PA_sk_master_2022-0509-173936
Alexandre Janniaux 4 years ago
parent
commit
53fa399a33
  1. 11
      modules/video_output/apple/VLCVideoUIView.m

11
modules/video_output/apple/VLCVideoUIView.m

@ -299,8 +299,6 @@
{
assert(_enabled);
_enabled = NO;
[_displayLink invalidate];
_displayLink = nil;
[self removeFromSuperview];
_constraints = nil;
@ -355,6 +353,14 @@
[self reshape];
}
- (void)pause
{
dispatch_sync(_eventq, ^{
[_displayLink invalidate];
_displayLink = nil;
});
}
- (void)applicationStateChanged:(NSNotification *)notification
{
[self reportEvent:^{
@ -407,6 +413,7 @@ static int Enable(vout_window_t *wnd, const vout_window_cfg_t *cfg)
static void Disable(vout_window_t *wnd)
{
VLCVideoUIView *sys = (__bridge VLCVideoUIView *)wnd->sys;
[sys pause];
dispatch_async(dispatch_get_main_queue(), ^{
[sys disable];
});

Loading…
Cancel
Save