return NULL;
}
-bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **errp)
+AudioState *audio_get_default_audio_state(Error **errp)
{
- if (!card->state) {
+ if (!default_audio_state) {
+ default_audio_state = audio_init(NULL, errp);
if (!default_audio_state) {
- default_audio_state = audio_init(NULL, errp);
- if (!default_audio_state) {
- if (!QSIMPLEQ_EMPTY(&audiodevs)) {
- error_append_hint(errp, "Perhaps you wanted to use -audio or set audiodev=%s?\n",
- QSIMPLEQ_FIRST(&audiodevs)->dev->id);
- }
- return false;
+ if (!QSIMPLEQ_EMPTY(&audiodevs)) {
+ error_append_hint(errp, "Perhaps you wanted to use -audio or set audiodev=%s?\n",
+ QSIMPLEQ_FIRST(&audiodevs)->dev->id);
}
}
- card->state = default_audio_state;
+ }
+
+ return default_audio_state;
+}
+
+bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **errp)
+{
+ if (!card->state) {
+ card->state = audio_get_default_audio_state(errp);
+ if (!card->state) {
+ return false;
+ }
}
card->name = g_strdup (name);
void audio_help(void);
AudioState *audio_state_by_name(const char *name, Error **errp);
+AudioState *audio_get_default_audio_state(Error **errp);
const char *audio_get_id(QEMUSoundCard *card);
#define DEFINE_AUDIO_PROPERTIES(_s, _f) \
Note that the default audio backend must be configured on the command
line if the ``-nodefaults`` options is used.
-Creating vnc without ``audiodev=`` property (removed in 8.2)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-When using vnc, you should specify an ``audiodev=`` property if
-you plan to transmit audio through the VNC protocol.
-
QEMU Machine Protocol (QMP) commands
------------------------------------