• Eduard Permyakov's avatar
    dsound: Commit next audio chunk between play cursor and write cursor to playing. · 975d0632
    Eduard Permyakov authored
    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: 's avatarEduard Permyakov <epermyakov@codeweavers.com>
    Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    975d0632
dsound_convert.c 10.4 KB