From b8527d7de45c54b6f1ec1d112786f9f60d42a825 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 15 Jun 2023 11:08:04 +0200 Subject: [PATCH] fix: Use `HostTimeClock` as fallback if `masterClock` is `nil` (#1302) --- ios/CameraView+RecordVideo.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/CameraView+RecordVideo.swift b/ios/CameraView+RecordVideo.swift index 7fdf962..0c5807c 100644 --- a/ios/CameraView+RecordVideo.swift +++ b/ios/CameraView+RecordVideo.swift @@ -202,8 +202,8 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud recordingSession.appendBuffer(sampleBuffer, type: .video, timestamp: CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) case is AVCaptureAudioDataOutput: let timestamp = CMSyncConvertTime(CMSampleBufferGetPresentationTimeStamp(sampleBuffer), - from: audioCaptureSession.masterClock!, - to: captureSession.masterClock!) + from: audioCaptureSession.masterClock ?? CMClockGetHostTimeClock(), + to: captureSession.masterClock ?? CMClockGetHostTimeClock()) recordingSession.appendBuffer(sampleBuffer, type: .audio, timestamp: timestamp) default: break