summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}