aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-09-16 10:41:16 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-09-23 08:36:50 +0200
commitf0c4555edfdd2088aab04b5779912d52b6b90454 (patch)
treeee73310bd8e424e4cbcd37beb0df51510b1b0af7 /audio/audio.c
parenta8a98cfd42f70ac1b725ee25e23154291228b330 (diff)
audio: remove qemu_spice_audio_init()
Handle the spice special case in audio_init instead. With the qemu_spice_audio_init() symbol dependency being gone we can build spiceaudio as module. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200916084117.21828-2-kraxel@redhat.com
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/audio/audio.c b/audio/audio.c
index 6ff3f168d7..46578e4a58 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -34,6 +34,7 @@
#include "qemu/module.h"
#include "sysemu/replay.h"
#include "sysemu/runstate.h"
+#include "ui/qemu-spice.h"
#include "trace.h"
#define AUDIO_CAP "audio"
@@ -1696,6 +1697,21 @@ static AudioState *audio_init(Audiodev *dev, const char *name)
/* silence gcc warning about uninitialized variable */
AudiodevListHead head = QSIMPLEQ_HEAD_INITIALIZER(head);
+ if (using_spice) {
+ /*
+ * When using spice allow the spice audio driver being picked
+ * as default.
+ *
+ * Temporary hack. Using audio devices without explicit
+ * audiodev= property is already deprecated. Same goes for
+ * the -soundhw switch. Once this support gets finally
+ * removed we can also drop the concept of a default audio
+ * backend and this can go away.
+ */
+ driver = audio_driver_lookup("spice");
+ driver->can_be_default = 1;
+ }
+
if (dev) {
/* -audiodev option */
legacy_config = false;