From 231636b9eb2ecd7d8669d309a74c3a51cd5ddfae Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 30 Jan 2009 20:12:38 +0100 Subject: 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(). --- src/output_thread.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/output_thread.c') diff --git a/src/output_thread.c b/src/output_thread.c index 66f66e88c..883dddcaf 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -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); -- cgit v1.2.3