diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 6de0e0ef2..839bdacd6 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -685,6 +685,11 @@ double Monitor::GetFPS() const double curr_fps = image_count/time_diff; + if ( curr_fps < 0.0 ) + { + //Error( "Negative FPS %f, time_diff = %lf (%d:%ld.%ld - %d:%ld.%ld), ibc: %d", curr_fps, time_diff, index2, time2.tv_sec, time2.tv_usec, index1, time1.tv_sec, time1.tv_usec, image_buffer_count ); + return( 0.0 ); + } return( curr_fps ); } diff --git a/web/ajax/stream.php b/web/ajax/stream.php index ece137901..50a400169 100644 --- a/web/ajax/stream.php +++ b/web/ajax/stream.php @@ -1,6 +1,6 @@ 0 ) { if ( count($rSockets) != 1 ) - ajaxError( "Bogus return from select" ); + ajaxError( "Bogus return from select, ".count($rSockets)." sockets available" ); } switch( $nbytes = @socket_recvfrom( $socket, $msg, MSG_DATA_SIZE, 0, $remSockFile ) )