aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-30 20:12:38 +0100
committerMax Kellermann <max@duempel.org>2009-01-30 20:12:38 +0100
commit231636b9eb2ecd7d8669d309a74c3a51cd5ddfae (patch)
treeec70993f5ce903e37dee4a49578c4c16bde222e7 /src/output_thread.c
parent6aa734dc355ee3d8d3deb03adb4013dddc45694f (diff)
downloadmpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.tar.gz
mpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.tar.xz
mpd-231636b9eb2ecd7d8669d309a74c3a51cd5ddfae.zip
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().
Diffstat (limited to 'src/output_thread.c')
-rw-r--r--src/output_thread.c12
1 files changed, 11 insertions, 1 deletions
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);