[vlc-commits] [Git][videolan/vlc][master] uikit-inhibit: fix threading issue
Hugo Beauzée-Luyssen
gitlab at videolan.org
Sat Jun 5 15:02:26 UTC 2021
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
3c23501e by Alexandre Janniaux at 2021-06-05T14:28:58+00:00
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.
- - - - -
1 changed file:
- modules/misc/inhibit/uikit-inhibit.m
Changes:
=====================================
modules/misc/inhibit/uikit-inhibit.m
=====================================
@@ -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)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3c23501ed48b215fe1c14aac64adbda03f0381bd
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3c23501ed48b215fe1c14aac64adbda03f0381bd
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list