diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-02-25 21:10:56 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-02-25 21:10:56 +0000 |
commit | 8edc416344afe51e3509d09e11a37c91517e0f6a (patch) | |
tree | 87917c82caffb575dad24880bbd00d71ec8fa99a /src/decode.c | |
parent | e1c839cd5679f9b60f6b5e2bfd3a341b64463456 (diff) | |
download | mpd-8edc416344afe51e3509d09e11a37c91517e0f6a.tar.gz mpd-8edc416344afe51e3509d09e11a37c91517e0f6a.tar.xz mpd-8edc416344afe51e3509d09e11a37c91517e0f6a.zip |
some more cleanups
git-svn-id: https://svn.musicpd.org/mpd/trunk@60 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/decode.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/decode.c b/src/decode.c index ecedc330a..f9e07db62 100644 --- a/src/decode.c +++ b/src/decode.c @@ -93,8 +93,8 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) { chunks = (af->sampleRate*af->bits*af->channels/8.0/CHUNK_SIZE); chunks = (chunks*pc->crossFade+0.5); - if(chunks>(BUFFERED_CHUNKS-buffered_before_play)) { - chunks = BUFFERED_CHUNKS-buffered_before_play; + if(chunks>(buffered_chunks-buffered_before_play)) { + chunks = buffered_chunks-buffered_before_play; } if(chunks<0) chunks = 0; @@ -338,19 +338,19 @@ void decode() { <=crossFadeChunks) || (cb->begin>cb->next && (fadePosition=cb->next-cb->begin+ - BUFFERED_CHUNKS)<=crossFadeChunks))) + buffered_chunks)<=crossFadeChunks))) { if(nextChunk<0) { crossFadeChunks = fadePosition; } nextChunk = cb->begin+crossFadeChunks; test = cb->end; - if(cb->wrap) test+=BUFFERED_CHUNKS; + if(cb->wrap) test+=buffered_chunks; if(nextChunk<test) { - if(nextChunk>=BUFFERED_CHUNKS) + if(nextChunk>=buffered_chunks) { nextChunk-= - BUFFERED_CHUNKS; + buffered_chunks; } pcm_mix(cb->chunks+cb->begin* CHUNK_SIZE, @@ -393,7 +393,7 @@ void decode() { playAudio(cb->chunks+cb->begin*CHUNK_SIZE, cb->chunkSize[cb->begin]); cb->begin++; - if(cb->begin>=BUFFERED_CHUNKS) { + if(cb->begin>=buffered_chunks) { cb->begin = 0; cb->wrap = 0; } @@ -404,12 +404,12 @@ void decode() { if(doCrossFade==1 && nextChunk>=0) { nextChunk = cb->begin+crossFadeChunks; test = cb->end; - if(cb->wrap) test+=BUFFERED_CHUNKS; + if(cb->wrap) test+=buffered_chunks; if(nextChunk<test) { - if(nextChunk>=BUFFERED_CHUNKS) + if(nextChunk>=buffered_chunks) { nextChunk-= - BUFFERED_CHUNKS; + buffered_chunks; } cb->begin = nextChunk; } |