diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder_control.c | 15 | ||||
-rw-r--r-- | src/decoder_control.h | 4 |
2 files changed, 13 insertions, 6 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); } diff --git a/src/decoder_control.h b/src/decoder_control.h index 6a04a1617..febf53335 100644 --- a/src/decoder_control.h +++ b/src/decoder_control.h @@ -118,10 +118,10 @@ void dc_command_wait(struct notify *notify); void -dc_start(struct notify *notify, struct song *song); +dc_start(struct notify *notify, struct song *song, struct music_pipe *pipe); void -dc_start_async(struct song *song); +dc_start_async(struct song *song, struct music_pipe *pipe); void dc_stop(struct notify *notify); |