Skip to content

Commit 0eefb94

Browse files
committed
Use a new task instead of assumeIsolated to try to fix crash on iOS 17
1 parent 34c374d commit 0eefb94

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Sources/SJSAssetExportSession/SampleWriter.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,13 @@ actor SampleWriter {
221221
}
222222

223223
audioInput.requestMediaDataWhenReady(on: queue) {
224-
// NOTE: assumeIsolated crashes on macOS with Swift 6.0, fixed in 6.1
225-
self.assumeIsolated { _self in
226-
_self.writeAllReadySamples()
227-
}
224+
Task { await self.writeAllReadySamples() }
228225
}
229226
}
230227

231228
private func startEncodingVideoTracks() {
232229
videoInput?.requestMediaDataWhenReady(on: queue) {
233-
// NOTE: assumeIsolated crashes on macOS with Swift 6.0, fixed in 6.1
234-
self.assumeIsolated { _self in
235-
_self.writeAllReadySamples()
236-
}
230+
Task { await self.writeAllReadySamples() }
237231
}
238232
}
239233

0 commit comments

Comments
 (0)