Merge remote-tracking branch 'origin/master'

This commit is contained in:
Yukino Song
2024-10-26 21:04:50 +08:00
32 changed files with 679 additions and 96 deletions

View File

@@ -124,9 +124,8 @@ namespace {
create_virtual_sink_waveformats() {
if constexpr (channel_count == 2) {
auto channel_mask = waveformat_mask_stereo;
// only choose 24 or 16-bit formats to avoid clobbering existing Dolby/DTS spatial audio settings
return {
create_waveformat(sample_format_e::f32, channel_count, channel_mask),
create_waveformat(sample_format_e::s32, channel_count, channel_mask),
create_waveformat(sample_format_e::s24in32, channel_count, channel_mask),
create_waveformat(sample_format_e::s24, channel_count, channel_mask),
create_waveformat(sample_format_e::s16, channel_count, channel_mask),

View File

@@ -1870,7 +1870,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;
}