From 431417ea8bbbd3053f5db3aa0b8fe484682dc283 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 3 Sep 2021 12:19:53 -0400 Subject: [PATCH] Use old time code as this is 1.36 --- src/zm_monitorstream.cpp | 6 +++--- src/zm_stream.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/zm_monitorstream.cpp b/src/zm_monitorstream.cpp index 33651bdbb..2831f196c 100644 --- a/src/zm_monitorstream.cpp +++ b/src/zm_monitorstream.cpp @@ -265,9 +265,9 @@ void MonitorStream::processCommand(const CmdMsg *msg) { status_data.forced = false; status_data.buffer_level = 0; } else { - FPSeconds elapsed = now - last_fps_update; - if (elapsed.count()) { - actual_fps = (frame_count - last_frame_count) / elapsed.count(); + int elapsed = now.tv_sec - last_fps_update.tv_sec; + if (elapsed) { + actual_fps = (frame_count - last_frame_count) / elapsed; last_frame_count = frame_count; last_fps_update = now; } diff --git a/src/zm_stream.h b/src/zm_stream.h index e1652a886..8ef42fefd 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -125,7 +125,7 @@ protected: double base_fps; // Should be capturing fps, hence a rough target double effective_fps; // Target fps after taking max_fps into account double actual_fps; // sliding calculated actual streaming fps achieved - SystemTimePoint last_fps_update; + struct timeval last_fps_update; int frame_count; // Count of frames sent int last_frame_count; // Used in calculating actual_fps from frame_count - last_frame_count @@ -175,6 +175,7 @@ public: base_fps(0.0), effective_fps(0.0), actual_fps(0.0), + last_fps_update({}), frame_count(0), last_frame_count(0), frame_mod(1)