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
This commit is contained in:
Warren Dukes
2004-06-08 18:55:16 +00:00
parent c274d7d62f
commit 6f4a55ea7c
4 changed files with 18 additions and 28 deletions
+5 -4
View File
@@ -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;