aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-08 13:45:24 +0100
committerMax Kellermann <max@duempel.org>2009-03-08 13:45:24 +0100
commit94d1a87d0432d885756f9d23cfba1f8229cfe453 (patch)
tree1c5358045a47e07556c8476cefb8c33181e567fd /src/pipe.h
parent359f9871b230b0f3e986ea7fb30e93b9730b683b (diff)
downloadmpd-94d1a87d0432d885756f9d23cfba1f8229cfe453.tar.gz
mpd-94d1a87d0432d885756f9d23cfba1f8229cfe453.tar.xz
mpd-94d1a87d0432d885756f9d23cfba1f8229cfe453.zip
music_chunk: added assertions on the audio format
In !NDEBUG, remember which audio_format is stored in every chunk and every pipe. Check the audio_format of every new data block appended to the music_chunk, and the format of every new chunk appended to the music_pipe.
Diffstat (limited to 'src/pipe.h')
-rw-r--r--src/pipe.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pipe.h b/src/pipe.h
index 7ed6c917d..dd97ce820 100644
--- a/src/pipe.h
+++ b/src/pipe.h
@@ -19,6 +19,12 @@
#ifndef MPD_PIPE_H
#define MPD_PIPE_H
+#ifndef NDEBUG
+#include <stdbool.h>
+
+struct audio_format;
+#endif
+
struct music_chunk;
struct music_buffer;
@@ -40,6 +46,16 @@ music_pipe_new(void);
void
music_pipe_free(struct music_pipe *mp);
+#ifndef NDEBUG
+/**
+ * Checks if the audio format if the chunk is equal to the specified
+ * audio_format.
+ */
+bool
+music_pipe_check_format(const struct music_pipe *pipe,
+ const struct audio_format *audio_format);
+#endif
+
/**
* Returns the first #music_chunk from the pipe. Returns NULL if the
* pipe is empty.