aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:14:09 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:14:09 +0000
commit646260b19e2084bb3d81986929cc8fa0291068e5 (patch)
treeb9222bf4346fef40d03ebeb154b31ae00207d610 /src/decode.c
parentdc55e13ca1ac382770a80b7f1bf984fe7acb5066 (diff)
downloadmpd-646260b19e2084bb3d81986929cc8fa0291068e5.tar.gz
mpd-646260b19e2084bb3d81986929cc8fa0291068e5.tar.xz
mpd-646260b19e2084bb3d81986929cc8fa0291068e5.zip
moved expression to audioFormatSizeToTime()
The multi-line expression which calculates sizeToTime is hard to read, partly because "cb->audioFormat." is too long. Create a separate inline function in audio.h for that. git-svn-id: https://svn.musicpd.org/mpd/trunk@7277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/decode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/decode.c b/src/decode.c
index 066176116..495251a09 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -466,9 +466,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
pc->sampleRate = dc->audioFormat.sampleRate;
pc->bits = dc->audioFormat.bits;
pc->channels = dc->audioFormat.channels;
- sizeToTime = 8.0/cb->audioFormat.bits/
- cb->audioFormat.channels/
- cb->audioFormat.sampleRate;
+ sizeToTime = audioFormatSizeToTime(&cb->audioFormat);
}
else if(dc->state!=DECODE_STATE_START) {
/* the decoder failed */