Fix frame_count fps when paused
This commit is contained in:
parent
381fa0d08d
commit
328bd15360
|
@ -637,6 +637,7 @@ void MonitorStream::runStream() {
|
|||
if (!sendFrame(temp_image_buffer[temp_index].file_name, temp_image_buffer[temp_index].timestamp)) {
|
||||
zm_terminate = true;
|
||||
}
|
||||
frame_count++;
|
||||
last_frame_timestamp = swap_image->timestamp;
|
||||
// frame_sent = true;
|
||||
}
|
||||
|
@ -655,6 +656,7 @@ void MonitorStream::runStream() {
|
|||
) {
|
||||
zm_terminate = true;
|
||||
}
|
||||
frame_count++;
|
||||
|
||||
last_frame_timestamp = swap_image->timestamp;
|
||||
// frame_sent = true;
|
||||
|
@ -670,6 +672,7 @@ void MonitorStream::runStream() {
|
|||
if (!sendFrame(temp_image_buffer[temp_index].file_name, temp_image_buffer[temp_index].timestamp)) {
|
||||
zm_terminate = true;
|
||||
}
|
||||
frame_count++;
|
||||
// frame_sent = true;
|
||||
}
|
||||
} // end if (!paused) or step or paused
|
||||
|
@ -706,6 +709,7 @@ void MonitorStream::runStream() {
|
|||
zm_terminate = true;
|
||||
break;
|
||||
}
|
||||
frame_count++;
|
||||
if (frame_count == 0) {
|
||||
// Chrome will not display the first frame until it receives another.
|
||||
// Firefox is fine. So just send the first frame twice.
|
||||
|
@ -728,6 +732,8 @@ void MonitorStream::runStream() {
|
|||
zm_terminate = true;
|
||||
if (!sendFrame(paused_image, paused_timestamp))
|
||||
zm_terminate = true;
|
||||
frame_count++;
|
||||
frame_count++;
|
||||
} else {
|
||||
SystemTimePoint::duration actual_delta_time = now - last_frame_sent;
|
||||
if (actual_delta_time > Seconds(5)) {
|
||||
|
@ -738,6 +744,7 @@ void MonitorStream::runStream() {
|
|||
// Send the next frame
|
||||
if (!sendFrame(paused_image, paused_timestamp))
|
||||
zm_terminate = true;
|
||||
frame_count++;
|
||||
} else {
|
||||
Debug(2, "Would have sent keepalive frame, but had no paused_image");
|
||||
}
|
||||
|
@ -774,7 +781,6 @@ void MonitorStream::runStream() {
|
|||
Warning("Unable to store frame as shared memory invalid");
|
||||
}
|
||||
} // end if buffered playback
|
||||
frame_count++;
|
||||
} else {
|
||||
Debug(3, "Waiting for capture last_write_index=%u", monitor->shared_data->last_write_index);
|
||||
} // end if ( (unsigned int)last_read_index != monitor->shared_data->last_write_index )
|
||||
|
|
Loading…
Reference in New Issue