don't calc fps if no time has passed
parent
c3cfd096c7
commit
a9419064ef
|
@ -2984,8 +2984,10 @@ Debug(4, "Return from Capture (%d)", captureResult);
|
||||||
} else {
|
} else {
|
||||||
now.tv_sec = image_buffer[index].timestamp->tv_sec;
|
now.tv_sec = image_buffer[index].timestamp->tv_sec;
|
||||||
}
|
}
|
||||||
|
// If we are too fast, we get div by zero. This seems to happen in the case of audio packets.
|
||||||
|
if ( now.tv_sec != last_fps_time ) {
|
||||||
fps = double(fps_report_interval)/(now.tv_sec-last_fps_time);
|
fps = double(fps_report_interval)/(now.tv_sec-last_fps_time);
|
||||||
Info( "%d -> %d -> %d", fps_report_interval, now, last_fps_time );
|
Info( "%d -> %d -> %d", fps_report_interval, now.tv_sec, last_fps_time );
|
||||||
//Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps );
|
//Info( "%d -> %d -> %lf -> %lf", now-last_fps_time, fps_report_interval/(now-last_fps_time), double(fps_report_interval)/(now-last_fps_time), fps );
|
||||||
Info( "%s: %d - Capturing at %.2lf fps", name, image_count, fps );
|
Info( "%s: %d - Capturing at %.2lf fps", name, image_count, fps );
|
||||||
last_fps_time = now.tv_sec;
|
last_fps_time = now.tv_sec;
|
||||||
|
@ -2995,6 +2997,7 @@ Debug(4, "Return from Capture (%d)", captureResult);
|
||||||
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
Error( "Can't run query: %s", mysql_error( &dbconn ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Icon: I'm not sure these should be here. They have nothing to do with capturing
|
// Icon: I'm not sure these should be here. They have nothing to do with capturing
|
||||||
if ( shared_data->action & GET_SETTINGS ) {
|
if ( shared_data->action & GET_SETTINGS ) {
|
||||||
|
|
Loading…
Reference in New Issue