From 6f4a55ea7c22bf054d4b9fa5fda9738048982bbd Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 8 Jun 2004 18:55:16 +0000 Subject: remove "wrap" from buffering control, its not needed, and could potentially create a race condition (but hasn't happened in the last 10 months since this code was written) git-svn-id: https://svn.musicpd.org/mpd/trunk@1397 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/outputBuffer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/outputBuffer.c') diff --git a/src/outputBuffer.c b/src/outputBuffer.c index 40777db3b..39d9b66af 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -42,7 +42,6 @@ void clearOutputBuffer(OutputBuffer * cb) { currentChunk = -1; cb->end = cb->begin; - cb->wrap = 0; /* be sure to reset metaChunkSets cause we are skipping over audio * audio chunks, and thus skipping over metadata */ @@ -60,7 +59,6 @@ void flushOutputBuffer(OutputBuffer * cb) { cb->end++; if(cb->end>=buffered_chunks) { cb->end = 0; - cb->wrap = 1; } currentChunk = -1; } @@ -97,8 +95,11 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream, while(datalen) { if(currentChunk != cb->end) { - while(cb->begin==cb->end && cb->wrap && !dc->stop) - { + int next = cb->end+1; + if(next>=buffered_chunks) { + next = 0; + } + while(cb->begin==next && !dc->stop) { if(dc->seek) { if(seekable) { return OUTPUT_BUFFER_DC_SEEK; -- cgit v1.2.3