Commit 6801d676c0ce09e168195ec024e0d7033138b73f

Ryan C. Gordon 2022-11-16T09:52:33

Revert "pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small." This reverts commit d8b1ef42aee52dad4ac3de69795ca2e8d2fd7704. This turned out to be unnecessary (it was a problem on the user's system, not an SDL bug). Reference Issue #6121.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c
index 9934a56..288c3d9 100644
--- a/src/audio/pulseaudio/SDL_pulseaudio.c
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c
@@ -630,13 +630,7 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname)
     paattr.prebuf = -1;
     paattr.maxlength = -1;
     paattr.minreq = -1;
-
-    /* don't let this change the global device's latency if the number is
-       extremely small, as it will affect other applications. Without this
-       flag, it only affects this specific stream. */
-    if (this->spec.samples >= 512) {
-        flags |= PA_STREAM_ADJUST_LATENCY;
-    }
+    flags |= PA_STREAM_ADJUST_LATENCY;
 
     if (ConnectToPulseServer(&h->mainloop, &h->context) < 0) {
         return SDL_SetError("Could not connect to PulseAudio server");