All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [PULL 8/9] audio: remove qemu_spice_audio_init()
Date: Wed, 23 Sep 2020 11:10:00 +0200	[thread overview]
Message-ID: <20200923091001.20814-9-kraxel@redhat.com> (raw)
In-Reply-To: <20200923091001.20814-1-kraxel@redhat.com>

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
---
 include/ui/qemu-spice.h |  1 -
 audio/audio.c           | 16 ++++++++++++++++
 audio/spiceaudio.c      |  5 -----
 ui/spice-core.c         |  1 -
 4 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index 8c23dfe71797..12474d88f40e 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -29,7 +29,6 @@ extern int using_spice;
 
 void qemu_spice_init(void);
 void qemu_spice_input_init(void);
-void qemu_spice_audio_init(void);
 void qemu_spice_display_init(void);
 int qemu_spice_display_add_client(int csock, int skipauth, int tls);
 int qemu_spice_add_interface(SpiceBaseInstance *sin);
diff --git a/audio/audio.c b/audio/audio.c
index 6ff3f168d7b7..46578e4a583b 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;
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
index c062742622e4..ed6dff1dcc41 100644
--- a/audio/spiceaudio.c
+++ b/audio/spiceaudio.c
@@ -311,11 +311,6 @@ static struct audio_driver spice_audio_driver = {
     .voice_size_in  = sizeof (SpiceVoiceIn),
 };
 
-void qemu_spice_audio_init (void)
-{
-    spice_audio_driver.can_be_default = 1;
-}
-
 static void register_audio_spice(void)
 {
     audio_driver_register(&spice_audio_driver);
diff --git a/ui/spice-core.c b/ui/spice-core.c
index ecc2ec2c55c2..10aa309f78f7 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -804,7 +804,6 @@ void qemu_spice_init(void)
     qemu_spice_add_interface(&spice_migrate.base);
 
     qemu_spice_input_init();
-    qemu_spice_audio_init();
 
     qemu_add_vm_change_state_handler(vm_change_state_handler, NULL);
     qemu_spice_display_stop();
-- 
2.27.0



  parent reply	other threads:[~2020-09-23  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  9:09 [PULL 0/9] Audio 20200923 patches Gerd Hoffmann
2020-09-23  9:09 ` [PULL 1/9] audio: handle buf == NULL in put_buffer_out() Gerd Hoffmann
2020-09-23  9:09 ` [PULL 2/9] audio/audio: fix video playback slowdown with spiceaudio Gerd Hoffmann
2020-09-23  9:09 ` [PULL 3/9] audio/spiceaudio: always rate limit playback stream Gerd Hoffmann
2020-09-23  9:09 ` [PULL 4/9] audio: align audio_generic_read with audio_pcm_hw_run_in Gerd Hoffmann
2020-09-23  9:09 ` [PULL 5/9] audio: remove unnecessary calls to put_buffer_in Gerd Hoffmann
2020-09-23  9:09 ` [PULL 6/9] audio: align audio_generic_write with audio_pcm_hw_run_out Gerd Hoffmann
2020-09-23  9:09 ` [PULL 7/9] audio: run downstream playback queue unconditionally Gerd Hoffmann
2020-09-23  9:10 ` Gerd Hoffmann [this message]
2020-09-23  9:10 ` [PULL 9/9] audio: build spiceaudio as module Gerd Hoffmann
2020-09-24 17:48 ` [PULL 0/9] Audio 20200923 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200923091001.20814-9-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.