Use old time code as this is 1.36

This commit is contained in:
Isaac Connor 2021-09-03 12:19:53 -04:00
parent e0e81a3769
commit 431417ea8b
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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)