dsoundaudio: fix never-ending playback loop
commit4ba664cb0aabecfc425aa94cd025c515e6251539
authorVolker Rümelin <vr_qemu@t-online.de>
Sun, 5 Apr 2020 07:50:15 +0000 (5 09:50 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 6 Apr 2020 11:29:53 +0000 (6 13:29 +0200)
tree0caba46dea8c7e0b01e07dc9769cb638416e04c7
parent146aa0f104bb3bf88e43c4082a0bfc4bbda4fbd8
dsoundaudio: fix never-ending playback loop

Currently the DirectSound backend fails to stop audio playback
in dsound_enable_out(). To detect a lost buffer condition
dsound_get_status_out() incorrectly uses the error code
DSERR_BUFFERLOST instead of flag DSBSTATUS_BUFFERLOST as a mask
and returns with an error. As a result dsound_enable_out()
returns early and doesn't stop playback.

To reproduce the bug start qemu on a Windows host with
-soundhw pcspk -audiodev dsound,id=audio0. On the guest
FreeDOS 1.2 command line enter beep. The image Day 1 - F-Bird
from the QEMU Advent Calendar 2018 shows the bug as well.

Buglink: https://bugs.launchpad.net/qemu/+bug/1699628
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200405075017.9901-1-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
audio/dsoundaudio.c