diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-02-25 17:53:48 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-02-25 17:53:48 +0000 |
commit | 46c66a2a3ee71b149cb9bd31349744a5bf532424 (patch) | |
tree | 980bce14fc1d9df0c68c68d305e40b4119fe78d4 /src/decode.c | |
parent | 1ff12306802f483445fc37083409f03ef5ce1873 (diff) | |
download | mpd-46c66a2a3ee71b149cb9bd31349744a5bf532424.tar.gz mpd-46c66a2a3ee71b149cb9bd31349744a5bf532424.tar.xz mpd-46c66a2a3ee71b149cb9bd31349744a5bf532424.zip |
a few cleanups
git-svn-id: https://svn.musicpd.org/mpd/trunk@53 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/decode.c')
-rw-r--r-- | src/decode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decode.c b/src/decode.c index 8f8b0da68..80789337e 100644 --- a/src/decode.c +++ b/src/decode.c @@ -93,10 +93,12 @@ 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) { + if(chunks>(BUFFERED_CHUNKS-buffered_before_play)) { chunks = BUFFERED_CHUNKS-buffered_before_play; } + if(chunks<0) chunks = 0; + return chunks; } @@ -338,7 +340,7 @@ void decode() { (fadePosition=cb->next-cb->begin+ BUFFERED_CHUNKS)<=crossFadeChunks))) { - if(nextChunk==-1) { + if(nextChunk<0) { crossFadeChunks = fadePosition; } nextChunk = cb->begin+crossFadeChunks; |