diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-08 18:55:16 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-08 18:55:16 +0000 |
commit | 6f4a55ea7c22bf054d4b9fa5fda9738048982bbd (patch) | |
tree | 9095791777929353334a3b8b44f570956f4afb83 /src/outputBuffer.c | |
parent | c274d7d62facdcf639b130f3abae0993f6c253aa (diff) | |
download | mpd-6f4a55ea7c22bf054d4b9fa5fda9738048982bbd.tar.gz mpd-6f4a55ea7c22bf054d4b9fa5fda9738048982bbd.tar.xz mpd-6f4a55ea7c22bf054d4b9fa5fda9738048982bbd.zip |
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
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; |