From f1791e1b050f80f604a659928949ec8545c2b06a Mon Sep 17 00:00:00 2001 From: Michael Davydov Date: Mon, 23 Sep 2019 01:36:13 +0600 Subject: [PATCH] Update SceneKitVideoRecorder.swift --- SceneKitVideoRecorder/Classes/SceneKitVideoRecorder.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SceneKitVideoRecorder/Classes/SceneKitVideoRecorder.swift b/SceneKitVideoRecorder/Classes/SceneKitVideoRecorder.swift index 06fc6f7..f02bb44 100644 --- a/SceneKitVideoRecorder/Classes/SceneKitVideoRecorder.swift +++ b/SceneKitVideoRecorder/Classes/SceneKitVideoRecorder.swift @@ -293,8 +293,6 @@ public class SceneKitVideoRecorder: NSObject, AVAudioRecorderDelegate { guard let pixelBuffer = pixelBufferTemp else { print("No buffer"); return } - guard videoInput.isReadyForMoreMediaData else { print("No ready for media data"); return } - if videoFramesWritten == false { videoFramesWritten = true startRecordingAudio() @@ -310,7 +308,9 @@ public class SceneKitVideoRecorder: NSObject, AVAudioRecorderDelegate { guard CMTIME_IS_VALID(appendTime) else { print("No append time"); return } bufferQueue.async { [weak self] in - self?.pixelBufferAdaptor.append(pixelBuffer, withPresentationTime: appendTime) + if true == self?.videoInput.isReadyForMoreMediaData { + self?.pixelBufferAdaptor.append(pixelBuffer, withPresentationTime: appendTime) + } } } }