fix: Prevent NaN/+Inf crash for auto frameProcessorFps
This commit is contained in:
parent
7335883969
commit
d9932f4b7a
@ -250,7 +250,7 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud
|
||||
|
||||
let maxFrameProcessorFps = Double(videoDevice.activeVideoMinFrameDuration.timescale) * Double(videoDevice.activeVideoMinFrameDuration.value)
|
||||
let averageFps = 1.0 / frameProcessorPerformanceDataCollector.averageExecutionTimeSeconds
|
||||
let suggestedFrameProcessorFps = floor(min(averageFps, maxFrameProcessorFps))
|
||||
let suggestedFrameProcessorFps = max(floor(min(averageFps, maxFrameProcessorFps)), 1)
|
||||
|
||||
if frameProcessorFps.intValue == -1 {
|
||||
// frameProcessorFps="auto"
|
||||
|
Loading…
Reference in New Issue
Block a user