aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-12-13 21:12:48 +0100
committerMax Kellermann <max@duempel.org>2011-12-13 21:58:07 +0100
commitb66d7f7e0b551b8dba9a7811a0c25cdfa8fea6f7 (patch)
treefc0c2baa970408d7e9ceebfd09dc65e101fb4760 /src
parente01df06cd7b4331436564942c931ed351fb4e76f (diff)
downloadmpd-b66d7f7e0b551b8dba9a7811a0c25cdfa8fea6f7.tar.gz
mpd-b66d7f7e0b551b8dba9a7811a0c25cdfa8fea6f7.tar.xz
mpd-b66d7f7e0b551b8dba9a7811a0c25cdfa8fea6f7.zip
output/fifo: implement output_plugin method delay()
Diffstat (limited to '')
-rw-r--r--src/output/fifo_output_plugin.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/output/fifo_output_plugin.c b/src/output/fifo_output_plugin.c
index f7c88cdc8..b8f405624 100644
--- a/src/output/fifo_output_plugin.c
+++ b/src/output/fifo_output_plugin.c
@@ -259,6 +259,16 @@ fifo_output_cancel(struct audio_output *ao)
}
}
+static unsigned
+fifo_output_delay(struct audio_output *ao)
+{
+ struct fifo_data *fd = (struct fifo_data *)ao;
+
+ return fd->timer->started
+ ? timer_delay(fd->timer)
+ : 0;
+}
+
static size_t
fifo_output_play(struct audio_output *ao, const void *chunk, size_t size,
GError **error)
@@ -268,9 +278,6 @@ fifo_output_play(struct audio_output *ao, const void *chunk, size_t size,
if (!fd->timer->started)
timer_start(fd->timer);
- else
- timer_sync(fd->timer);
-
timer_add(fd->timer, size);
while (true) {
@@ -302,6 +309,7 @@ const struct audio_output_plugin fifo_output_plugin = {
.finish = fifo_output_finish,
.open = fifo_output_open,
.close = fifo_output_close,
+ .delay = fifo_output_delay,
.play = fifo_output_play,
.cancel = fifo_output_cancel,
};