aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-23 21:11:15 -0700
committerEric Wong <normalperson@yhbt.net>2008-08-23 21:11:15 -0700
commita81b1b674443eb80d9f5ee56f78cf3739adf4cfd (patch)
treeae531e92b7e3dae93d33f2577f6148947bf5577e /src
parent8439e0ce44b895931fd821da5a31fa53e3fcd421 (diff)
downloadmpd-a81b1b674443eb80d9f5ee56f78cf3739adf4cfd.tar.gz
mpd-a81b1b674443eb80d9f5ee56f78cf3739adf4cfd.tar.xz
mpd-a81b1b674443eb80d9f5ee56f78cf3739adf4cfd.zip
xfade: gracefully fail on very short xfade times
It's possible to calculate an impossibly small value that we don't have a chance to xfade. Don't die if we can't find the boundary to start crossfading on
Diffstat (limited to 'src')
-rw-r--r--src/outputBuffer_xfade.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/outputBuffer_xfade.h b/src/outputBuffer_xfade.h
index 48084c44b..336a7adc2 100644
--- a/src/outputBuffer_xfade.h
+++ b/src/outputBuffer_xfade.h
@@ -48,7 +48,8 @@ static size_t calculate_xfade_chunks(struct iovec vec[2])
assert(c);
} while (chunks && c->seq == ob.seq_decoder);
assert((c = get_chunk(vec, chunks)));
- assert(c->seq != ob.seq_decoder);
+ if (!chunks && c->seq != ob.seq_decoder)
+ return 0; /* nothing to xfade */
++chunks;
assert((c = get_chunk(vec, chunks)));
assert(c->seq == ob.seq_decoder);