aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:13:51 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:13:51 +0000
commit2e648b57f3f1c83f2694033900489a8290a55868 (patch)
treefec820c988db72573cb4c8c11945f3224298e22c /src/outputBuffer.c
parent11a5728e1d9d80795f3accd3a15a9704b3497e1a (diff)
downloadmpd-2e648b57f3f1c83f2694033900489a8290a55868.tar.gz
mpd-2e648b57f3f1c83f2694033900489a8290a55868.tar.xz
mpd-2e648b57f3f1c83f2694033900489a8290a55868.zip
added outputBufferShift()
Hiding OutputBuffer internals, yet again. Two more assertions. git-svn-id: https://svn.musicpd.org/mpd/trunk@7274 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r--src/outputBuffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 48e9598f6..525f4af24 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -56,6 +56,16 @@ int outputBufferEmpty(const OutputBuffer * cb)
return cb->begin == cb->end;
}
+void outputBufferShift(OutputBuffer * cb)
+{
+ assert(cb->begin != cb->end);
+ assert(cb->begin < buffered_chunks);
+
+ ++cb->begin;
+ if (cb->begin >= buffered_chunks)
+ cb->begin = 0;
+}
+
unsigned int outputBufferRelative(const OutputBuffer * cb, unsigned i)
{
if (i >= cb->begin)