aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:16:13 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:16:13 +0000
commitee64bba4d9f367de624c6a9cb8c2920c89aae727 (patch)
tree78576712fd712e722181bbf943ffbbf4138a157e /src
parent1ad2f07a3930291e488642ff7ef2f1c4314b7c36 (diff)
downloadmpd-ee64bba4d9f367de624c6a9cb8c2920c89aae727.tar.gz
mpd-ee64bba4d9f367de624c6a9cb8c2920c89aae727.tar.xz
mpd-ee64bba4d9f367de624c6a9cb8c2920c89aae727.zip
some assertions to check the unsigned changes
git-svn-id: https://svn.musicpd.org/mpd/trunk@7297 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/decode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/decode.c b/src/decode.c
index d49699dfb..fea4f8b8b 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -88,6 +88,7 @@ static unsigned calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af,
chunks = (af->sampleRate * af->bits * af->channels / 8.0 / CHUNK_SIZE);
chunks = (chunks * pc->crossFade + 0.5);
+ assert(buffered_chunks >= buffered_before_play);
if (chunks > (buffered_chunks - buffered_before_play)) {
chunks = buffered_chunks - buffered_before_play;
}
@@ -367,6 +368,8 @@ static void crossFade(OutputBufferChunk * a, OutputBufferChunk * b,
AudioFormat * format,
unsigned int fadePosition, unsigned int crossFadeChunks)
{
+ assert(fadePosition <= crossFadeChunks);
+
pcm_mix(a->data,
b->data,
a->chunkSize,