Try to fix background glitching over long periods of time
Build and test / test (macos-latest) (push) Waiting to run
Build and test / test (ubuntu-24.04) (push) Waiting to run
Build and test / test (windows-latest) (push) Waiting to run
Build and test / apple-client (push) Waiting to run

This commit is contained in:
2026-09-24 13:31:16 +02:00
parent 186fe6dbb6
commit fb740bcfb2
7 changed files with 129 additions and 14 deletions
+16
View File
@@ -446,6 +446,22 @@ public class AudioEngineTests
Assert.Contains("public void Resynchronize()", buffer);
}
[Fact]
public void ResynchronizeInputsDropsStalledBacklogToTheBufferTarget()
{
using var send = new AudioEngine((_, _, _, _) => true, false);
send.DeviceBufferMilliseconds = 40; send.AddLocalStream(Stream());
short[] mono = Tone();
for (int i = 0; i < 40; i++) send.FeedPcm(1, mono, 1);
Assert.True(send.GetLocalDiagnostics(1).BufferedFrames > 1920 * 2);
send.ResynchronizeInputs();
Assert.Equal(1920, send.GetLocalDiagnostics(1).BufferedFrames);
send.ProcessCycle();
Assert.Equal(0, send.GetLocalDiagnostics(1).StarvedCycles);
}
[Fact]
public void RemotePlaybackSettingsAreIndependentForEachUserStream()
{