From abfb5642c8c39decb2090445ba7c19a039d72fa3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 6 Mar 2019 09:46:28 -0500 Subject: [PATCH] cleanup and document updateFrameRate --- src/zm_stream.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index bff550a77..335091946 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -70,14 +70,16 @@ void StreamBase::updateFrameRate(double fps) { } base_fps = fps; effective_fps = (base_fps*abs(replay_rate))/ZM_RATE_BASE; - Debug(3, "FPS:%.2f, MXFPS:%.2f, BFPS:%.2f, EFPS:%.2f, FM:%d", fps, maxfps, base_fps, effective_fps, frame_mod); + Debug(3, "FPS:%.2f, MXFPS:%.2f, BFPS:%.2f, EFPS:%.2f, FM:%d", + fps, maxfps, base_fps, effective_fps, frame_mod); // Min frame repeat? - while( effective_fps > maxfps ) { + // We want to keep the frame skip easy... problem is ... if effective = 31 and max = 30 then we end up with 15.5 fps. + while ( effective_fps > maxfps ) { effective_fps /= 2.0; frame_mod *= 2; Debug(3, "EffectiveFPS:%.2f, FrameMod:%d", effective_fps, frame_mod); } -} +} // void StreamBase::updateFrameRate(double fps) bool StreamBase::checkCommandQueue() { if ( sd >= 0 ) {