aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decoder_control.c8
-rw-r--r--src/decoder_control.h16
2 files changed, 20 insertions, 4 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c
index 058cd3f33..7fe18088b 100644
--- a/src/decoder_control.c
+++ b/src/decoder_control.c
@@ -84,12 +84,16 @@ dc_command_async(struct decoder_control *dc, enum decoder_command cmd)
}
void
-dc_start(struct decoder_control *dc, struct song *song)
+dc_start(struct decoder_control *dc, struct song *song,
+ struct music_buffer *buffer, struct music_pipe *pipe)
{
- assert(dc->pipe != NULL);
assert(song != NULL);
+ assert(buffer != NULL);
+ assert(pipe != NULL);
dc->song = song;
+ dc->buffer = buffer;
+ dc->pipe = pipe;
dc_command(dc, DECODE_COMMAND_START);
}
diff --git a/src/decoder_control.h b/src/decoder_control.h
index 635855e17..38c4f0d83 100644
--- a/src/decoder_control.h
+++ b/src/decoder_control.h
@@ -84,7 +84,10 @@ struct decoder_control {
/** the #music_chunk allocator */
struct music_buffer *buffer;
- /** the destination pipe for decoded chunks */
+ /**
+ * The destination pipe for decoded chunks. The caller thread
+ * owns this object, and is responsible for freeing it.
+ */
struct music_pipe *pipe;
};
@@ -211,8 +214,17 @@ decoder_current_song(const struct decoder_control *dc)
void
dc_command_wait(struct decoder_control *dc);
+/**
+ * Start the decoder.
+ *
+ * @param the decoder
+ * @param song the song to be decoded
+ * @param pipe the pipe which receives the decoded chunks (owned by
+ * the caller)
+ */
void
-dc_start(struct decoder_control *dc, struct song *song);
+dc_start(struct decoder_control *dc, struct song *song,
+ struct music_buffer *buffer, struct music_pipe *pipe);
void
dc_stop(struct decoder_control *dc);