aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/outputBuffer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index d15a947e3..f5a6dbf51 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -57,6 +57,14 @@ void flushOutputBuffer(OutputBuffer * cb)
}
}
+unsigned availableOutputBuffer(const OutputBuffer * cb)
+{
+ if (cb->end >= cb->begin)
+ return cb->end - cb->begin;
+ else
+ return cb->end + buffered_chunks - cb->begin;
+}
+
/**
* Return the tail chunk has room for additional data. If there is no
* room in the queue, this function blocks until the player thread has