output_api: moved the command check out of method pause()

Move the "while" loop which checks for commands to the caller
ao_pause().  This simplifies the pause() method, and lets us remove
audio_output_is_pending().
This commit is contained in:
Max Kellermann
2009-01-30 20:12:38 +01:00
parent 6aa734dc35
commit 231636b9eb
4 changed files with 18 additions and 24 deletions
+11 -1
View File
@@ -77,7 +77,17 @@ static void ao_pause(struct audio_output *ao)
if (ao->plugin->pause != NULL) {
/* pause is supported */
ao_command_finished(ao);
ao->plugin->pause(ao->data);
do {
bool ret;
ret = ao->plugin->pause(ao->data);
if (!ret) {
ao->plugin->close(ao->data);
pcm_convert_deinit(&ao->convState);
ao->open = false;
}
} while (ao->command == AO_COMMAND_NONE);
} else {
/* pause is not supported - simply close the device */
ao->plugin->close(ao->data);