aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/null_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-23 09:29:56 +0100
committerMax Kellermann <max@duempel.org>2009-02-23 09:29:56 +0100
commit5a898c15e79ab87d2466e61549fcc20ce115c67e (patch)
treecb65b88718b0b8f3cf05221816b193833c41fe8a /src/output/null_plugin.c
parentd50a3d513eb0452e762f1e4eeb717318958cd83c (diff)
downloadmpd-5a898c15e79ab87d2466e61549fcc20ce115c67e.tar.gz
mpd-5a898c15e79ab87d2466e61549fcc20ce115c67e.tar.xz
mpd-5a898c15e79ab87d2466e61549fcc20ce115c67e.zip
output_api: play() returns a length
The old API required an output plugin to not return until all data passed to the play() method is consumed. Some output plugins have to loop to fulfill that requirement, and may block during that. Simplify these, by letting them consume only part of the buffer: make play() return the length of the consumed data.
Diffstat (limited to 'src/output/null_plugin.c')
-rw-r--r--src/output/null_plugin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/output/null_plugin.c b/src/output/null_plugin.c
index 1ae55ca9b..2506feb74 100644
--- a/src/output/null_plugin.c
+++ b/src/output/null_plugin.c
@@ -74,14 +74,14 @@ null_close(void *data)
}
}
-static bool
+static size_t
null_play(void *data, G_GNUC_UNUSED const char *chunk, size_t size)
{
struct null_data *nd = data;
Timer *timer = nd->timer;
if (!nd->sync)
- return true;
+ return size;
if (!timer->started)
timer_start(timer);
@@ -90,7 +90,7 @@ null_play(void *data, G_GNUC_UNUSED const char *chunk, size_t size)
timer_add(timer, size);
- return true;
+ return size;
}
static void