fix: Use HostTimeClock
as fallback if masterClock
is nil
(#1302)
This commit is contained in:
parent
8753af3633
commit
b8527d7de4
@ -202,8 +202,8 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud
|
|||||||
recordingSession.appendBuffer(sampleBuffer, type: .video, timestamp: CMSampleBufferGetPresentationTimeStamp(sampleBuffer))
|
recordingSession.appendBuffer(sampleBuffer, type: .video, timestamp: CMSampleBufferGetPresentationTimeStamp(sampleBuffer))
|
||||||
case is AVCaptureAudioDataOutput:
|
case is AVCaptureAudioDataOutput:
|
||||||
let timestamp = CMSyncConvertTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer),
|
let timestamp = CMSyncConvertTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer),
|
||||||
from: audioCaptureSession.masterClock!,
|
from: audioCaptureSession.masterClock ?? CMClockGetHostTimeClock(),
|
||||||
to: captureSession.masterClock!)
|
to: captureSession.masterClock ?? CMClockGetHostTimeClock())
|
||||||
recordingSession.appendBuffer(sampleBuffer, type: .audio, timestamp: timestamp)
|
recordingSession.appendBuffer(sampleBuffer, type: .audio, timestamp: timestamp)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user