diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-07-29 15:03:26 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-07-29 15:03:26 +0000 |
commit | f15b4c7c704292ee88ae05919adc88a2765684cf (patch) | |
tree | 712495d01757986acec8e216e60165ea21704b4a /src/pulsecore/memblockq.c | |
parent | 9310a2e3b88286fdb60f52c4b8a8c51848ffca53 (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.c | 6 |
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; } |