Skip to content

Commit

Permalink
fix(video): encode at least one frame before capture reinit (#3300)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman authored Oct 15, 2024
1 parent 7352e72 commit bd2e1dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,14 @@ 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 we've encoded at least one frame
//
// If we have to reinit before we have received any captured frames, we will encode
// the blank dummy frame just to let Moonlight know that we're alive.
if (shutdown_event->peek() || !images->running() || (reinit_event.peek() && frame_nr > 1)) {
break;
}

Expand Down

0 comments on commit bd2e1dc

Please sign in to comment.