output: close device on play error

When an output plugin fails to play a chunk, close it.  This replaces
various manual close() calls in nearly all plugins.
This commit is contained in:
Max Kellermann
2008-10-29 20:40:33 +01:00
parent 58c5bee9f0
commit 2f76db4c78
7 changed files with 7 additions and 12 deletions

View File

@@ -62,6 +62,11 @@ static void ao_play(struct audio_output *ao)
convertAudioFormat(ao, &data, &size);
ao->result = ao->plugin->play(ao->data, data, size);
if (!ao->result) {
ao->plugin->close(ao->data);
ao->open = false;
}
ao_command_finished(ao);
}