aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutput.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audioOutput.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c
index 5352be012..24899e814 100644
--- a/src/audioOutput.c
+++ b/src/audioOutput.c
@@ -28,13 +28,16 @@ AudioOutput * newAudioOutput(char * name) {
if(findInList(audioOutputPluginList, name, &data)) {
AudioOutputPlugin * plugin = (AudioOutputPlugin *) data;
ret = malloc(sizeof(AudioOutput));
- ret->finishDriverFunc = plugin->initDriverFunc;
+ ret->finishDriverFunc = plugin->finishDriverFunc;
ret->openDeviceFunc = plugin->openDeviceFunc;
ret->playFunc = plugin->playFunc;
ret->closeDeviceFunc = plugin->closeDeviceFunc;
ret->open = 0;
- plugin->initDriverFunc(ret);
+ if(plugin->initDriverFunc(ret) != 0) {
+ free(ret);
+ ret = NULL;
+ }
}
return ret;