fix: Fix a race condition that caused audio to not be configured (#2144)

* fix: Fix a race condition that caused audio to not be configured

* Update CameraSession.swift

* fix: Fix `audioOutput` being deleted
This commit is contained in:
Marc Rousavy 2023-11-10 12:08:39 +01:00 committed by GitHub
parent 69baacad73
commit 1b90bc9620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -62,7 +62,6 @@ extension CameraSession {
}
photoOutput = nil
videoOutput = nil
audioOutput = nil
codeScannerOutput = nil
// Photo Output

View File

@ -158,9 +158,6 @@ class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVC
}
}
// Update successful, set the new configuration!
self.configuration = config
// Notify about Camera initialization
if difference.inputChanged {
self.delegate?.onSessionInitialized()
@ -188,6 +185,9 @@ class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate, AVC
}
}
}
// After configuring, set this to the new configuration.
configuration = config
}
/**