OSDN Git Service

paaudio: drop recording stream in qpa_fini_in
authorVolker Rümelin <vr_qemu@t-online.de>
Sat, 4 Jan 2020 09:11:20 +0000 (10:11 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 6 Jan 2020 07:47:16 +0000 (08:47 +0100)
commit4db3e634c77a671fadbba6d4d39e0d21232e5609
treec58d34021f606dddb231c31ebde87cf9265da68d
parentc435fea72bbae2c37e4ae375cbecfee0d4a5470c
paaudio: drop recording stream in qpa_fini_in

Every call to pa_stream_peek which returns a data length > 0
should have a corresponding pa_stream_drop. A call to qpa_read
does not necessarily call pa_stream_drop immediately after a
call to pa_stream_peek. Test in qpa_fini_in if a last
pa_stream_drop is needed.

This prevents following messages in the libvirt log file after
a recording stream gets closed and a new one opened.

pulseaudio: pa_stream_drop failed
pulseaudio: Reason: Bad state
pulseaudio: pa_stream_drop failed
pulseaudio: Reason: Bad state

To reproduce start qemu with
-audiodev pa,id=audio0,in.mixing-engine=off
and in the guest start and stop Audacity several times.

Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-id: 20200104091122.13971-3-vr_qemu@t-online.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
audio/paaudio.c