Skip to content

Commit

Permalink
GetLastWriteIndex returns -1 when it is equal to image_buffer_count
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Oct 28, 2024
1 parent 6cc423b commit 9f536cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9f536cc

Please sign in to comment.