mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
vbox: vboxDumpAudio: invert conditions
Elimination of the positive conditions reduces the indentation by two levels. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
a7464a3f01
commit
4a1f4e898b
@ -3798,20 +3798,16 @@ vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED,
|
|||||||
PRUint32 audioController = AudioControllerType_AC97;
|
PRUint32 audioController = AudioControllerType_AC97;
|
||||||
|
|
||||||
def->nsounds = 1;
|
def->nsounds = 1;
|
||||||
if (VIR_ALLOC_N(def->sounds, def->nsounds) >= 0) {
|
if (VIR_ALLOC_N(def->sounds, def->nsounds) < 0)
|
||||||
if (VIR_ALLOC(def->sounds[0]) >= 0) {
|
return;
|
||||||
gVBoxAPI.UIAudioAdapter.GetAudioController(audioAdapter, &audioController);
|
if (VIR_ALLOC(def->sounds[0]) < 0)
|
||||||
if (audioController == AudioControllerType_SB16) {
|
return;
|
||||||
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_SB16;
|
|
||||||
} else if (audioController == AudioControllerType_AC97) {
|
gVBoxAPI.UIAudioAdapter.GetAudioController(audioAdapter, &audioController);
|
||||||
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_AC97;
|
if (audioController == AudioControllerType_SB16) {
|
||||||
}
|
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_SB16;
|
||||||
} else {
|
} else if (audioController == AudioControllerType_AC97) {
|
||||||
VIR_FREE(def->sounds);
|
def->sounds[0]->model = VIR_DOMAIN_SOUND_MODEL_AC97;
|
||||||
def->nsounds = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
def->nsounds = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VBOX_RELEASE(audioAdapter);
|
VBOX_RELEASE(audioAdapter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user