summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/memblockq.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-29 15:03:26 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-29 15:03:26 +0000
commitf15b4c7c704292ee88ae05919adc88a2765684cf (patch)
tree712495d01757986acec8e216e60165ea21704b4a /src/pulsecore/memblockq.c
parent9310a2e3b88286fdb60f52c4b8a8c51848ffca53 (diff)
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
Diffstat (limited to 'src/pulsecore/memblockq.c')
-rw-r--r--src/pulsecore/memblockq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index ff199f1b..822bd66c 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.c
@@ -368,6 +368,12 @@ int pa_memblockq_peek(pa_memblockq* bq, pa_memchunk *chunk) {
chunk->length = length;
} else {
+
+ /* If the memblockq is empty, return -1, otherwise return
+ * the time to sleep */
+ if (!bq->blocks)
+ return -1;
+
chunk->memblock = NULL;
chunk->length = length;
}