aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_internal.h')
-rw-r--r--src/decoder_internal.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/decoder_internal.h b/src/decoder_internal.h
index 53b6b5cf3..ab52ab037 100644
--- a/src/decoder_internal.h
+++ b/src/decoder_internal.h
@@ -19,8 +19,11 @@
#ifndef MPD_DECODER_INTERNAL_H
#define MPD_DECODER_INTERNAL_H
+#include "decoder_command.h"
#include "pcm_convert.h"
+struct input_stream;
+
struct decoder {
struct pcm_convert_state conv_state;
@@ -31,6 +34,25 @@ struct decoder {
/** the last tag received from the decoder plugin */
struct tag *decoder_tag;
+
+ /** the chunk currently being written to */
+ struct music_chunk *chunk;
};
+/**
+ * Returns the current chunk the decoder writes to, or allocates a new
+ * chunk if there is none.
+ */
+struct music_chunk *
+decoder_get_chunk(struct decoder *decoder);
+
+/**
+ * Flushes a chunk. Waits for room in the music pipe if required.
+ *
+ * @return DECODE_COMMAND_NONE on success, any other command if we
+ * have received a decoder command while waiting
+ */
+enum decoder_command
+decoder_flush_chunk(struct decoder *decoder, struct input_stream *is);
+
#endif