Try to fix background glitching over long periods of time
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user