aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderInternal.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/DecoderInternal.hxx48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/DecoderInternal.hxx b/src/DecoderInternal.hxx
index 46069a561..fbd613a36 100644
--- a/src/DecoderInternal.hxx
+++ b/src/DecoderInternal.hxx
@@ -20,18 +20,21 @@
#ifndef MPD_DECODER_INTERNAL_HXX
#define MPD_DECODER_INTERNAL_HXX
-#include "DecoderCommand.hxx"
-#include "pcm/PcmConvert.hxx"
#include "ReplayGainInfo.hxx"
+#include "util/Error.hxx"
+class PcmConvert;
struct DecoderControl;
-struct InputStream;
struct Tag;
struct Decoder {
DecoderControl &dc;
- PcmConvert conv_state;
+ /**
+ * For converting input data to the configured audio format.
+ * nullptr means no conversion necessary.
+ */
+ PcmConvert *convert;
/**
* The time stamp of the next data chunk, in seconds.
@@ -83,8 +86,15 @@ struct Decoder {
*/
unsigned replay_gain_serial;
+ /**
+ * An error has occurred (in DecoderAPI.cxx), and the plugin
+ * will be asked to stop.
+ */
+ Error error;
+
Decoder(DecoderControl &_dc, bool _initial_seek_pending, Tag *_tag)
:dc(_dc),
+ convert(nullptr),
timestamp(0),
initial_seek_pending(_initial_seek_pending),
initial_seek_running(false),
@@ -95,23 +105,21 @@ struct Decoder {
}
~Decoder();
-};
-/**
- * Returns the current chunk the decoder writes to, or allocates a new
- * chunk if there is none.
- *
- * @return the chunk, or NULL if we have received a decoder command
- */
-struct music_chunk *
-decoder_get_chunk(Decoder &decoder);
+ /**
+ * Returns the current chunk the decoder writes to, or allocates a new
+ * chunk if there is none.
+ *
+ * @return the chunk, or NULL if we have received a decoder command
+ */
+ music_chunk *GetChunk();
-/**
- * Flushes the current chunk.
- *
- * Caller must not lock the #DecoderControl object.
- */
-void
-decoder_flush_chunk(Decoder &decoder);
+ /**
+ * Flushes the current chunk.
+ *
+ * Caller must not lock the #DecoderControl object.
+ */
+ void FlushChunk();
+};
#endif