[3.0.x] caopengllayer: fix using layer outside of main thread
When stopping the playback, vout_display_t destructor will call the [VideoView vlcClose] which references the backing CALayer through [self layer]. This function is not thread-safe and should only be called from the main thread, leading to reports and crashes when using the main thread checker.
Instead, since we allocate the layer and references it from the vout_display_t implementation, just send the vlcClose message on the stored layer directly. Since it's only used to pass from the vd from the view to the layer, and it's initialized from a dispatch_sync() in the Open() function, there won't be race de-initializing them in a non-synchronized fashion like done in this commit.
Fixes #27513 (closed)
(cherry picked from commit 79e1535a) (back-port of !4974 (merged))
Merge request reports
Activity
changed milestone to %3.0.21
added Component::Video: macOS / iOS / tvOS / visionOS label
added MRStatus::Reviewable label
added MRStatus::Acceptable label and removed MRStatus::Reviewable label
added MRStatus::Accepted label and removed MRStatus::Acceptable label
MR Acceptance result
This MergeRequest has been Accepted! Congratulations.MR acceptance checks details:
-
MR should be considered mergeable by Gitlab -
Last pipeline should be successful -
MergeRequest should have at least one external review and/or vote -
All threads should be resolved, and score >= 0 -
MergeRequest should have no activity (threads/votes) for (24h/24h)
-
added 4 commits
-
ec12d8c7...f3d178c2 - 3 commits from branch
videolan:3.0.x
- b7843ec8 - caopengllayer: fix using layer outside of main thread
-
ec12d8c7...f3d178c2 - 3 commits from branch
enabled an automatic merge when the pipeline for b7843ec8 succeeds