aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:18:12 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:18:12 +0000
commite20b71ed63314d68407b5583e67f2617f916a9e4 (patch)
tree19f7c18f7c8939e33651f84a76319e131ec146ee /src/decode.c
parente9e557c8d1562d0215e4e4a4c2f361457aec43a9 (diff)
downloadmpd-e20b71ed63314d68407b5583e67f2617f916a9e4.tar.gz
mpd-e20b71ed63314d68407b5583e67f2617f916a9e4.tar.xz
mpd-e20b71ed63314d68407b5583e67f2617f916a9e4.zip
remove buffered_chunks, use cb->size
Second patch to make OutputBuffer self-contained: since OutputBuffer now knows its own size, we do not need the global variable "buffered_chunks" anymore. git-svn-id: https://svn.musicpd.org/mpd/trunk@7311 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index c5ad1c817..6e04a12e9 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -79,7 +79,7 @@ static void quitDecode(PlayerControl * pc, DecoderControl * dc)
static unsigned calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af,
float totalTime)
{
- unsigned chunks;
+ unsigned int buffered_chunks, chunks;
if (pc->crossFade == 0 || pc->crossFade >= totalTime ||
!isCurrentAudioFormat(af))
@@ -93,6 +93,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);
+ buffered_chunks = getPlayerData()->buffer.size;
assert(buffered_chunks >= buffered_before_play);
if (chunks > (buffered_chunks - buffered_before_play))
chunks = buffered_chunks - buffered_before_play;