Rémi Bernon : winepulse.drv: Stop writing the same data again on underflow.

Alexandre Julliard julliard at winehq.org
Fri Dec 17 15:14:55 CST 2021


Module: wine
Branch: master
Commit: 6995b77a6d0111bba045ed1dafa348cc465bc5c8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6995b77a6d0111bba045ed1dafa348cc465bc5c8

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Dec 16 18:20:24 2021 +0100

winepulse.drv: Stop writing the same data again on underflow.

Data in [lcl_offs_bytes;lcl_offs_bytes+held_bytes] is the data we've
received from the client and that we consider being used by pulse,
regardless of how we write it to it.

A subset of this is [pa_offs_bytes;pa_offs_bytes+pa_held_bytes], which
is the data we have received from the client but not yet written to
pulse.

If pulsed has underflown it means that it has used all the data we've
written already, and resetting pa_offs_bytes and pa_held_bytes like here
will only make us write the same data again (in addition to silence) to
mend the underflow, ending up with potentially duplicate audio frames
being played.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52225
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winepulse.drv/pulse.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index bce70ac358c..c329e8c423c 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -260,9 +260,6 @@ static void pulse_underflow_callback(pa_stream *s, void *userdata)
     struct pulse_stream *stream = userdata;
     WARN("%p: Underflow\n", userdata);
     stream->just_underran = TRUE;
-    /* re-sync */
-    stream->pa_offs_bytes = stream->lcl_offs_bytes;
-    stream->pa_held_bytes = stream->held_bytes;
 }
 
 static void pulse_started_callback(pa_stream *s, void *userdata)




More information about the wine-cvs mailing list