Commit 3c23501e authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Hugo Beauzée-Luyssen
Browse files

uikit-inhibit: fix threading issue

The UIKit functions must be called from the main thread, whereas the
functions from the inhibiter can be called from the vout thread. It
didn't seem to have any consequence on iPad, or the testing I did was
not triggering the crash, but it's leading to a crash on tvOS when
running with VLCKit.
parent e94b04c8
......@@ -34,8 +34,10 @@
static void UpdateInhibit(vlc_inhibit_t *ih, unsigned mask)
{
[UIApplication sharedApplication].idleTimerDisabled =
(mask & VLC_INHIBIT_DISPLAY) == VLC_INHIBIT_DISPLAY;
dispatch_async(dispatch_get_main_queue(), ^{
[UIApplication sharedApplication].idleTimerDisabled =
(mask & VLC_INHIBIT_DISPLAY) == VLC_INHIBIT_DISPLAY;
});
}
static int OpenInhibit(vlc_object_t *obj)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment