mirror of
https://github.com/qemu/qemu.git
synced 2026-05-18 19:54:09 +00:00
audio: disable default backends if -audio/-audiodev is used
Match what is done for other options, for example -monitor, and also the behavior of QEMU 8.1 (see the "legacy_config" variable). Require the user to specify a backend if one is specified on the command line. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -1688,14 +1688,10 @@ static const VMStateDescription vmstate_audio = {
|
||||
|
||||
static void audio_validate_opts(Audiodev *dev, Error **errp);
|
||||
|
||||
static void audio_create_default_audiodevs(void)
|
||||
void audio_create_default_audiodevs(void)
|
||||
{
|
||||
const char *drvname = getenv("QEMU_AUDIO_DRV");
|
||||
|
||||
if (!defaults_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* QEMU_AUDIO_DRV=none is used by libqtest. */
|
||||
if (drvname && !g_str_equal(drvname, "none")) {
|
||||
error_report("Please use -audiodev instead of QEMU_AUDIO_*");
|
||||
@@ -1827,9 +1823,6 @@ bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **errp)
|
||||
}
|
||||
card->state = QTAILQ_FIRST(&audio_states);
|
||||
} else {
|
||||
if (QSIMPLEQ_EMPTY(&default_audiodevs)) {
|
||||
audio_create_default_audiodevs();
|
||||
}
|
||||
card->state = audio_init(NULL, errp);
|
||||
if (!card->state) {
|
||||
if (!QSIMPLEQ_EMPTY(&audiodevs)) {
|
||||
|
||||
@@ -170,6 +170,7 @@ void audio_sample_from_uint64(void *samples, int pos,
|
||||
|
||||
void audio_define(Audiodev *audio);
|
||||
void audio_parse_option(const char *opt);
|
||||
void audio_create_default_audiodevs(void);
|
||||
void audio_init_audiodevs(void);
|
||||
void audio_help(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user