music_pipe: refuse to push empty chunks
Added two assertions.
This commit is contained in:
parent
85cc46ad6f
commit
bd6bcfb676
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user