fix(stepdown): restart the audio pipe around encoder changes

A quality step-down now closes the named audio pipe before stopping/flushing the
pump, then opens a fresh server before restarting the pump. This prevents ffmpeg
from waiting on the old audio input and avoids reconnecting to a broken pipe.

EncoderRestartTests pins the audio-stop → video-stop → audio-start → video-start
order. 616 tests green, clean build with 0 warnings.
This commit is contained in:
2026-11-11 09:52:27 -08:00
parent 2c5a3d8c11
commit 24077e58cf
4 changed files with 34 additions and 9 deletions
+3 -1
View File
@@ -74,7 +74,9 @@ public partial class MainViewModel
_encoderTierOverride = landed;
AppLog.Write($"Quality step-down: {decision.Why}");
await _framePump.ChangeEncoderAsync();
await _framePump.ChangeEncoderAsync(
_audioMixer.StopLive,
() => _audioMixer.StartLive(InstanceProfile.AudioPipeName(EncoderOptions.DefaultAudioPipeName)));
// Show what is actually going out. The dropdown keeps the creator's choice — the policy
// does not get to rewrite their intent, only the encoder's output.