Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(video): encode at least one frame before capture reinit #3300

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading