Merge branch 'master' of github.com:ZoneMinder/zoneminder
commit
8c32998e1c
|
@ -1378,11 +1378,11 @@ SystemTimePoint Monitor::GetTimestamp(int index) const {
|
|||
return {};
|
||||
}
|
||||
|
||||
unsigned int Monitor::GetLastReadIndex() const {
|
||||
int Monitor::GetLastReadIndex() const {
|
||||
return ( shared_data->last_read_index != image_buffer_count ? shared_data->last_read_index : -1 );
|
||||
}
|
||||
|
||||
unsigned int Monitor::GetLastWriteIndex() const {
|
||||
int Monitor::GetLastWriteIndex() const {
|
||||
return ( shared_data->last_write_index != image_buffer_count ? shared_data->last_write_index : -1 );
|
||||
}
|
||||
|
||||
|
|
|
@ -840,8 +840,8 @@ class Monitor : public std::enable_shared_from_this<Monitor> {
|
|||
unsigned int GetCaptureMaxFPS() const { return capture_max_fps; }
|
||||
Microseconds GetCaptureDelay() const { return capture_delay; }
|
||||
Microseconds GetAlarmCaptureDelay() const { return alarm_capture_delay; }
|
||||
unsigned int GetLastReadIndex() const;
|
||||
unsigned int GetLastWriteIndex() const;
|
||||
int GetLastReadIndex() const;
|
||||
int GetLastWriteIndex() const;
|
||||
uint64_t GetLastEventId() const;
|
||||
double GetFPS() const;
|
||||
void UpdateFPS();
|
||||
|
|
|
@ -297,7 +297,7 @@ int main(int argc, char *argv[]) {
|
|||
time_t last_viewed = monitors[i]->getLastViewed();
|
||||
int64 since_last_view = static_cast<int64>(std::chrono::duration_cast<Seconds>(now.time_since_epoch()).count()) - last_viewed;
|
||||
Debug(1, "Last view %jd= %" PRId64 " seconds since last view", last_viewed, since_last_view);
|
||||
if (((!last_viewed) or (since_last_view > 10)) and (monitors[i]->GetLastWriteIndex() != monitors[i]->GetImageBufferCount())) {
|
||||
if (((!last_viewed) or (since_last_view > 10)) and (monitors[i]->GetLastWriteIndex() != -1)) {
|
||||
if (monitors[i]->getCamera()->isPrimed()) {
|
||||
monitors[i]->Pause();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue