diff options
author | Max Kellermann <max@duempel.org> | 2010-11-05 17:42:08 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-11-05 19:18:44 +0100 |
commit | cc261872c25be3a5792be8ae160e070d1bbedf0b (patch) | |
tree | 6261d4dc29ad8c8e7b189585c4d0583f1727b664 /src/decoder_control.c | |
parent | 5223261f1907a642ebe741518b7981830c094924 (diff) | |
download | mpd-cc261872c25be3a5792be8ae160e070d1bbedf0b.tar.gz mpd-cc261872c25be3a5792be8ae160e070d1bbedf0b.tar.xz mpd-cc261872c25be3a5792be8ae160e070d1bbedf0b.zip |
decoder_control: pass music_pipe to dc_start()
More abstraction for decoder_control.pipe.
Diffstat (limited to '')
-rw-r--r-- | src/decoder_control.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c index 44bb63e15..618c78e7e 100644 --- a/src/decoder_control.c +++ b/src/decoder_control.c @@ -18,6 +18,7 @@ */ #include "decoder_control.h" +#include "pipe.h" #include <assert.h> @@ -58,22 +59,28 @@ static void dc_command_async(enum decoder_command cmd) } void -dc_start(struct notify *notify, struct song *song) +dc_start(struct notify *notify, struct song *song, struct music_pipe *pipe) { - assert(dc.pipe != NULL); + assert(dc.pipe == NULL); assert(song != NULL); + assert(pipe != NULL); + assert(music_pipe_empty(pipe)); dc.next_song = song; + dc.pipe = pipe; dc_command(notify, DECODE_COMMAND_START); } void -dc_start_async(struct song *song) +dc_start_async(struct song *song, struct music_pipe *pipe) { - assert(dc.pipe != NULL); + assert(dc.pipe == NULL); assert(song != NULL); + assert(pipe != NULL); + assert(music_pipe_empty(pipe)); dc.next_song = song; + dc.pipe = pipe; dc_command_async(DECODE_COMMAND_START); } |