Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safety audioMixerSettings. #1510

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all 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
6 changes: 4 additions & 2 deletions Sources/IO/IOStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/// The `IOStream` class is the foundation of a RTMPStream.
open class IOStream: NSObject {
/// The AVAudioEngine shared instance holder.
static let audioEngineHolder: InstanceHolder<AVAudioEngine> = .init {

Check warning on line 38 in Sources/IO/IOStream.swift

View workflow job for this annotation

GitHub Actions / build

static property 'audioEngineHolder' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
return AVAudioEngine()
}

Expand Down Expand Up @@ -185,10 +185,12 @@
/// Specifies the audio mixer settings.
public var audioMixerSettings: IOAudioMixerSettings {
get {
mixer.audioIO.mixerSettings
mixer.audioIO.lockQueue.sync { self.mixer.audioIO.mixerSettings }
}
set {
mixer.audioIO.mixerSettings = newValue
mixer.audioIO.lockQueue.async {
self.mixer.audioIO.mixerSettings = newValue
}
}
}

Expand Down
Loading