From 94d1a87d0432d885756f9d23cfba1f8229cfe453 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Mar 2009 13:45:24 +0100 Subject: 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. --- src/pipe.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/pipe.h') diff --git a/src/pipe.h b/src/pipe.h index 7ed6c917..dd97ce82 100644 --- a/src/pipe.h +++ b/src/pipe.h @@ -19,6 +19,12 @@ #ifndef MPD_PIPE_H #define MPD_PIPE_H +#ifndef NDEBUG +#include + +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. -- cgit v1.2.3