aboutsummaryrefslogtreecommitdiffstats
path: root/src/pipe.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-07 21:41:25 +0100
committerMax Kellermann <max@duempel.org>2009-03-07 21:41:25 +0100
commitbd6bcfb6760ecd6b89175f578d89f15c809ac2a4 (patch)
tree6bcbf1b6c32fb792fe293ea1f3ca44b0b60b15e4 /src/pipe.c
parent85cc46ad6fc9c7e2edfc274011f5c7a94e5e0b3e (diff)
downloadmpd-bd6bcfb6760ecd6b89175f578d89f15c809ac2a4.tar.gz
mpd-bd6bcfb6760ecd6b89175f578d89f15c809ac2a4.tar.xz
mpd-bd6bcfb6760ecd6b89175f578d89f15c809ac2a4.zip
music_pipe: refuse to push empty chunks
Added two assertions.
Diffstat (limited to 'src/pipe.c')
-rw-r--r--src/pipe.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 076185d2a..c433aa254 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -76,6 +76,8 @@ music_pipe_shift(struct music_pipe *mp)
chunk = mp->head;
if (chunk != NULL) {
+ assert(!music_chunk_is_empty(chunk));
+
mp->head = chunk->next;
--mp->size;
@@ -112,6 +114,8 @@ music_pipe_clear(struct music_pipe *mp, struct music_buffer *buffer)
void
music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk)
{
+ assert(!music_chunk_is_empty(chunk));
+
g_mutex_lock(mp->mutex);
chunk->next = NULL;