]> git.proxmox.com Git - mirror_qemu.git/commit - audio/audio_template.h
audio: Don't free hw resources until after hw backend is stopped
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 16 Dec 2014 16:58:05 +0000 (16:58 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 22 Dec 2014 23:12:25 +0000 (23:12 +0000)
commitb28fb27b5edf77f6fd0ac550a156fb20f2218db3
tree4b7365e1e655036a1e1639b7cc6b7f6e0479edcf
parent7e58e2ac7778cca3234c33387e49577bb7732714
audio: Don't free hw resources until after hw backend is stopped

When stopping an audio voice, call the audio backend's fini
method before calling audio_pcm_hw_free_resources_ rather than
afterwards. This allows backends which use helper threads (like
pulseaudio) to terminate those threads before the conv_buf or
mix_buf are freed and avoids race conditions where the helper
may access a NULL pointer or freed memory.

Cc: qemu-stable@nongnu.org
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1418406239-9838-1-git-send-email-peter.maydell@linaro.org
audio/audio_template.h