Skip to content

Commit 500ee34

Browse files
committed
fix(audio): resolve AVAudioFormat Sendable error and deprecated String(cString:) warning
1 parent c93c10d commit 500ee34

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/AudioEngine/Sources/AudioEngine/Decoder/FFmpegDecoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private extension FFmpegDecoder {
372372
private func ffError(_ code: Int32) -> Error {
373373
var buf = [CChar](repeating: 0, count: 256)
374374
av_strerror(code, &buf, buf.count)
375-
return FFmpegInternalError.code(code, String(cString: buf))
375+
return FFmpegInternalError.code(code, String(decoding: buf.prefix(while: { $0 != 0 }).map(UInt8.init), as: UTF8.self))
376376
}
377377

378378
private enum FFmpegInternalError: Error, LocalizedError {

Modules/AudioEngine/Sources/AudioEngine/Errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import AVFoundation
1+
@preconcurrency import AVFoundation
22

33
/// All errors produced by the `AudioEngine` module.
44
///

0 commit comments

Comments
 (0)