Skip to content

Commit

Permalink
fix(video): encode pending frames before capture reinit
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Oct 13, 2024
1 parent 5b435fd commit e518849
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,11 @@ namespace video {
}

while (true) {
if (shutdown_event->peek() || reinit_event.peek() || !images->running()) {
// Break out of the encoding loop if any of the following are true:
// a) The stream is ending
// b) Sunshine is quitting
// c) The capture side is waiting to reinit and all pending images have been encoded
if (shutdown_event->peek() || !images->running() || (reinit_event.peek() && !images->peek())) {
break;
}

Expand Down

0 comments on commit e518849

Please sign in to comment.