aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
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);