Commit ee64bba4 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

some assertions to check the unsigned changes

git-svn-id: https://svn.musicpd.org/mpd/trunk@7297 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 1ad2f07a
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment