aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-09 22:16:26 +0100
committerMax Kellermann <max@duempel.org>2009-11-09 22:16:26 +0100
commit3359f8785ef9b595b3ad943fdd2227f98ce56990 (patch)
tree248b51245d424b4700fffffb2eb8efd89f1ed6a0 /src/output_thread.c
parent96b974bc452e6b33ada281c5ccb4df7b9492e1da (diff)
downloadmpd-3359f8785ef9b595b3ad943fdd2227f98ce56990.tar.gz
mpd-3359f8785ef9b595b3ad943fdd2227f98ce56990.tar.xz
mpd-3359f8785ef9b595b3ad943fdd2227f98ce56990.zip
output_thread: added command DRAIN
This command manually drains the hardware buffer. This is useful when the player thread want to make sure that everything has been played.
Diffstat (limited to '')
-rw-r--r--src/output_thread.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output_thread.c b/src/output_thread.c
index 40906d82f..fb1701591 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -450,6 +450,19 @@ static gpointer audio_output_task(gpointer arg)
the new command first */
continue;
+ case AO_COMMAND_DRAIN:
+ if (ao->open) {
+ assert(ao->chunk == NULL);
+ assert(music_pipe_peek(ao->pipe) == NULL);
+
+ g_mutex_unlock(ao->mutex);
+ ao_plugin_drain(ao->plugin, ao->data);
+ g_mutex_lock(ao->mutex);
+ }
+
+ ao_command_finished(ao);
+ continue;
+
case AO_COMMAND_CANCEL:
ao->chunk = NULL;
if (ao->open)