Skip to content

Commit

Permalink
Reset decoding_image_count when Paused so that when we resume, the Re…
Browse files Browse the repository at this point in the history
…ady function waits for enough packets in queue.
  • Loading branch information
Isaac Connor committed Nov 6, 2024
1 parent 996d131 commit 96406e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/zm_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3396,6 +3396,7 @@ int Monitor::Pause() {
sws_freeContext(convert_context);
convert_context = nullptr;
}
decoding_image_count = 0;
}
if (analysis_thread) {
Debug(1, "Joining analysis");
Expand Down
2 changes: 1 addition & 1 deletion src/zm_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ class Monitor : public std::enable_shared_from_this<Monitor> {
return false;
}
if (decoding_image_count >= ready_count) {
Debug(4, "Ready because image_count(%d) >= ready_count(%d)", decoding_image_count, ready_count);
Debug(4, "Ready because decoding_image_count(%d) >= ready_count(%d)", decoding_image_count, ready_count);
return true;
}
Debug(4, "Not ready because decoding_image_count(%d) <= ready_count(%d)", decoding_image_count, ready_count);
Expand Down

0 comments on commit 96406e2

Please sign in to comment.