Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ccap_imp_apple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,18 @@ - (void)destroy {

[_videoOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()];

// setSampleBufferDelegate:queue: does not guarantee that captureOutput:
// blocks already enqueued on the previous capture queue have finished by
// the time it returns, especially when the new queue differs from the
// old one. Drain the original queue explicitly so ProviderImp (and its
// mutexes) cannot be torn down under an in-flight callback. Observed as
// crashes inside std::mutex::lock() in getFreeFrame() on macOS 26's
// AVCaptureVideoDataOutput_Tundra pipeline.
if (_captureQueue) {
dispatch_sync(_captureQueue, ^{
});
}
Comment thread
acida marked this conversation as resolved.
Outdated

[_session beginConfiguration];

if (_videoInput) {
Expand Down
Loading