aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:09 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:09 +0200
commit2650b9eb318a9eec0c45757624debf363aa156f9 (patch)
tree244afbf2e28d80a1f33e27e49bb3173ba448d8db /src/decode.c
parent0aedf7dd5a3f72a1c541085c513d2b85bc3bff58 (diff)
downloadmpd-2650b9eb318a9eec0c45757624debf363aa156f9.tar.gz
mpd-2650b9eb318a9eec0c45757624debf363aa156f9.tar.xz
mpd-2650b9eb318a9eec0c45757624debf363aa156f9.zip
added inline function audio_format_time_to_size()
Make the code more readable by hiding big formulas in an inline function with a nice name.
Diffstat (limited to 'src/decode.c')
-rw-r--r--src/decode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c
index da649ecea..f0c13f70c 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -78,7 +78,7 @@ static unsigned calculateCrossFadeChunks(AudioFormat * af,
assert(af->channels > 0);
assert(af->sampleRate > 0);
- chunks = (af->sampleRate * af->bits * af->channels / 8.0 / CHUNK_SIZE);
+ chunks = audio_format_time_to_size(af) / CHUNK_SIZE;
chunks = (chunks * pc.crossFade + 0.5);
if (chunks > max_chunks)