Skip to content
Snippets Groups Projects

[3.0.x] caopengllayer: fix using layer outside of main thread

Merged Felix Paul Kühne requested to merge fkuehne/vlc:bp-4974 into 3.0.x

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

Merge request pipeline #442553 passed

Merge request pipeline passed for b7843ec8

Approved by

Merged by Felix Paul KühneFelix Paul Kühne 1 year ago (Feb 27, 2024 11:38am UTC)

Merge details

  • Changes merged into 3.0.x with b7843ec8.
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #448193 passed

Pipeline passed for b7843ec8 on 3.0.x

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading