Eduard Permyakov : dsound: Commit next audio chunk between play cursor and write cursor to playing.

Alexandre Julliard julliard at winehq.org
Mon Sep 20 16:26:22 CDT 2021


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

Author: Eduard Permyakov <epermyakov at codeweavers.com>
Date:   Tue Sep 14 13:05:18 2021 +0300

dsound: Commit next audio chunk between play cursor and write cursor to playing.

This region of the audio buffer is forbidden to be written to by the
DirectSound specification. The documentation states: "The write cursor
is the point after which it is safe to write data into the buffer. The
block between the play cursor and the write cursor is already committed
to be played, and cannot be changed safely." However, some applications
still do this, which has lead to audio glitches only when using the Wine
DirectSound implementation. Experiments showed that the native DirctSound
implementation will still play the old audio the first time around when the
buffer region gets overwritten. Use an approach of copying the next forbidden
region into a "committed buffer" to add the same behavior to the Wine
implementation.

Out of performance considerations, only copy data to the committed buffer
when we detect that an overwrite is possible (i.e. the current mixing
region of the buffer gets locked).

Signed-off-by: Eduard Permyakov <epermyakov at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dsound/buffer.c         | 66 ++++++++++++++++++++++++++++++++++++++++++--
 dlls/dsound/dsound_convert.c | 33 +++++++++++-----------
 dlls/dsound/dsound_private.h | 11 ++++++--
 dlls/dsound/mixer.c          | 48 +++++++++++++++++++++++++-------
 4 files changed, 125 insertions(+), 33 deletions(-)

Diff:   https://source.winehq.org/git/wine.git/?a=commitdiff;h=975d0632a19efd41338cb73a97f1b0bdbe7bc0cc



More information about the wine-cvs mailing list