Use a new task instead of assumeIsolated to try to fix crash on iOS 17

This commit is contained in:
Sami Samhuri 2025-05-25 18:02:35 -07:00
parent 34c374d914
commit 0eefb949e2
No known key found for this signature in database

View file

@ -221,19 +221,13 @@ actor SampleWriter {
}
audioInput.requestMediaDataWhenReady(on: queue) {
// NOTE: assumeIsolated crashes on macOS with Swift 6.0, fixed in 6.1
self.assumeIsolated { _self in
_self.writeAllReadySamples()
}
Task { await self.writeAllReadySamples() }
}
}
private func startEncodingVideoTracks() {
videoInput?.requestMediaDataWhenReady(on: queue) {
// NOTE: assumeIsolated crashes on macOS with Swift 6.0, fixed in 6.1
self.assumeIsolated { _self in
_self.writeAllReadySamples()
}
Task { await self.writeAllReadySamples() }
}
}