Skip to content

Commit

Permalink
Merge pull request #1479 from stream-labs/bugfix/remove-shouldmix
Browse files Browse the repository at this point in the history
Remove shouldMix from multitrack mixer
  • Loading branch information
shogo4405 authored Jun 15, 2024
2 parents b9350d7 + 59754a3 commit ef1e83e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Sources/IO/IOAudioMixerByMultiTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible {
}
private var tracks: [UInt8: IOAudioMixerTrack<IOAudioMixerByMultiTrack>] = [:] {
didSet {
shouldMix = 1 < tracks.count
tryToSetupAudioNodes()
}
}
Expand All @@ -52,7 +51,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible {
}
}
}
private var shouldMix = false
private var mixerNode: MixerNode?
private var sampleTime: AVAudioFramePosition = IOAudioMixerByMultiTrack.defaultSampleTime
private var outputNode: OutputNode?
Expand Down Expand Up @@ -82,9 +80,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible {
}

private func tryToSetupAudioNodes() {
guard shouldMix else {
return
}
do {
try setupAudioNodes()
} catch {
Expand Down Expand Up @@ -183,10 +178,6 @@ extension IOAudioMixerByMultiTrack: IOAudioMixerTrackDelegate {
// MARK: IOAudioMixerTrackDelegate
func track(_ track: IOAudioMixerTrack<IOAudioMixerByMultiTrack>, didOutput audioPCMBuffer: AVAudioPCMBuffer, when: AVAudioTime) {
delegate?.audioMixer(self, track: track.id, didInput: audioPCMBuffer, when: when)
guard shouldMix else {
delegate?.audioMixer(self, didOutput: audioPCMBuffer, when: when)
return
}
buffers[track.id]?.append(audioPCMBuffer, when: when)
if settings.mainTrack == track.id {
if sampleTime == Self.defaultSampleTime {
Expand Down

0 comments on commit ef1e83e

Please sign in to comment.