Commit bd6bcfb6 authored by Max Kellermann's avatar Max Kellermann

music_pipe: refuse to push empty chunks

Added two assertions.
parent 85cc46ad
...@@ -76,6 +76,8 @@ music_pipe_shift(struct music_pipe *mp) ...@@ -76,6 +76,8 @@ music_pipe_shift(struct music_pipe *mp)
chunk = mp->head; chunk = mp->head;
if (chunk != NULL) { if (chunk != NULL) {
assert(!music_chunk_is_empty(chunk));
mp->head = chunk->next; mp->head = chunk->next;
--mp->size; --mp->size;
...@@ -112,6 +114,8 @@ music_pipe_clear(struct music_pipe *mp, struct music_buffer *buffer) ...@@ -112,6 +114,8 @@ music_pipe_clear(struct music_pipe *mp, struct music_buffer *buffer)
void void
music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk) music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk)
{ {
assert(!music_chunk_is_empty(chunk));
g_mutex_lock(mp->mutex); g_mutex_lock(mp->mutex);
chunk->next = NULL; chunk->next = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment