mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
audio: allow returning an error from the driver init
An error is already printed by audio_driver_init, but we can make it more precise if the driver can return an Error *. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
aaa6a6f93d
commit
f6061733a9
15 changed files with 48 additions and 27 deletions
|
@ -26,6 +26,7 @@
|
|||
#include <SDL.h>
|
||||
#include <SDL_thread.h>
|
||||
#include "qemu/module.h"
|
||||
#include "qapi/error.h"
|
||||
#include "audio.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -449,10 +450,10 @@ static void sdl_enable_in(HWVoiceIn *hw, bool enable)
|
|||
SDL_PauseAudioDevice(sdl->devid, !enable);
|
||||
}
|
||||
|
||||
static void *sdl_audio_init(Audiodev *dev)
|
||||
static void *sdl_audio_init(Audiodev *dev, Error **errp)
|
||||
{
|
||||
if (SDL_InitSubSystem (SDL_INIT_AUDIO)) {
|
||||
sdl_logerr ("SDL failed to initialize audio subsystem\n");
|
||||
error_setg(errp, "SDL failed to initialize audio subsystem");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue