if the memblockq is empty, return -1 in all cases

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1166 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-07-29 15:03:26 +00:00
parent 9310a2e3b8
commit f15b4c7c70

View file

@ -368,6 +368,12 @@ int pa_memblockq_peek(pa_memblockq* bq, pa_memchunk *chunk) {
chunk->length = length; chunk->length = length;
} else { } else {
/* If the memblockq is empty, return -1, otherwise return
* the time to sleep */
if (!bq->blocks)
return -1;
chunk->memblock = NULL; chunk->memblock = NULL;
chunk->length = length; chunk->length = length;
} }