aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:12:53 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:12:53 +0000
commit4e60343e552e8b7339678c6df7255a0f91dc769e (patch)
treeca4f2994b441819c28af63da20fe5279fd234050 /src/decode.c
parent50dc380f2385988047821fe15c5616f44019250f (diff)
downloadmpd-4e60343e552e8b7339678c6df7255a0f91dc769e.tar.gz
mpd-4e60343e552e8b7339678c6df7255a0f91dc769e.tar.xz
mpd-4e60343e552e8b7339678c6df7255a0f91dc769e.zip
added outputBufferRelative()
The cross-fade check is still very complicated whenever it uses OutputBuffer internals. Greatly simplify another check by introducing outputBufferRelative(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7264 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/decode.c b/src/decode.c
index 688d78322..55f272303 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -496,12 +496,8 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
else if (!outputBufferEmpty(cb) && cb->begin != next) {
unsigned int fadePosition;
if (doCrossFade == 1 && next >= 0 &&
- ((next > cb->begin &&
- (fadePosition = next - cb->begin)
- <= crossFadeChunks) ||
- (cb->begin > next &&
- (fadePosition = next - cb->begin +
- buffered_chunks) <= crossFadeChunks))) {
+ (fadePosition = outputBufferRelative(cb, next))
+ <= crossFadeChunks) {
/* perform cross fade */
if (nextChunk < 0) {
/* beginning of the cross fade