v5.2: stability and polish — deep-audit bug fixes + install-flow fixes

Verified findings from a multi-dimension code audit, plus the two install-flow bugs:
- Fix Opus encoder use-after-free on a codec/rate change while streaming (guard swap vs encode).
- Fix "both" single-file recording dropping audio + drifting (drain both directions in lockstep).
- Fix broken clip counter, UPnP teardown on exit, auto-update-restart foreground grant, and a
  malformed-Opus-format packet orphaning a playout session forever.
- Post-install relaunch now respects start-minimised; uninstall is path-aware so it won't clear a
  different copy's run-at-startup.
- Perf/hygiene: cache AppConfig off UI hot paths, fold per-peer EQ+gain into one pass, deterministic
  disposal (tray menu, timers, COM shortcut, Process handles, process meter), ring-buffer overflow
  guard, receiver session-lock fix, remote-control allow-list moved onto the UI thread.
- Remove dead code (two IsAsioBackend, SessionPlayout.Reset, IsSameEndpoint, RemSoundUpdater
  IDisposable); several stale-doc fixes.

Deferred (not in this release): drift-estimator tweak, peer-discovery pruning, uninstall retry-loop,
encryption nonce. Wire format unchanged (interops v3.3-v5.1). Version -> 5.2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ednunp
2026-07-09 20:54:53 +01:00
co-authored by Claude Opus 4.8
parent 7038fef67c
commit 2fb9274a95
28 changed files with 408 additions and 198 deletions
+7 -2
View File
@@ -15,6 +15,9 @@ namespace RemSound.App;
internal static class TabSwitchSoundService
{
private static CuePlayer? switchSound;
// Cached at Reload() so Play() (fires on every focused tab change) doesn't re-read + re-deserialize
// the whole config file just to fetch one bool. Reload() runs whenever cue settings change.
private static bool enableTabSwitch;
/// <summary>When true, <see cref="Play"/> is a no-op. Reserved for bulk programmatic tab changes
/// the focus gate doesn't already cover; mirrors <see cref="CheckSoundService.Suppressed"/>.</summary>
@@ -24,13 +27,15 @@ internal static class TabSwitchSoundService
/// settings change, alongside <see cref="CheckSoundService.Reload"/>.</summary>
public static void Reload()
{
switchSound = LoadCue(MainForm.CueId.TabSwitch, "tab switch.wav", AppConfig.Load());
var cfg = AppConfig.Load();
enableTabSwitch = cfg.EnableTabSwitchCue;
switchSound = LoadCue(MainForm.CueId.TabSwitch, "tab switch.wav", cfg);
}
public static void Play()
{
if (Suppressed) return;
if (AppConfig.Load().EnableTabSwitchCue) switchSound?.Play();
if (enableTabSwitch) switchSound?.Play();
}
private static CuePlayer? LoadCue(string cueId, string defaultFile, AppConfig cfg)