aboutsummaryrefslogtreecommitdiffstats
path: root/src/timer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-10 14:41:37 +0200
committerMax Kellermann <max@duempel.org>2008-10-10 14:41:37 +0200
commit96155a3376ef40eac9ca7a7b882da6447ab53979 (patch)
treeb30e5248b366b12ef860c65ea3640598f3b73658 /src/timer.c
parentde2cb3f37568e7680549057f8d7b6d748c388480 (diff)
downloadmpd-96155a3376ef40eac9ca7a7b882da6447ab53979.tar.gz
mpd-96155a3376ef40eac9ca7a7b882da6447ab53979.tar.xz
mpd-96155a3376ef40eac9ca7a7b882da6447ab53979.zip
audio_format: added audio_format_frame_size()
A frame contains one sample per channel, thus it is sample_size * channels. This patch includes some cleanup for various locations where the sample size for 24 bit audio was still 3 bytes (instead of 4).
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timer.c b/src/timer.c
index 84c03fbe6..46e1cdd86 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -40,7 +40,7 @@ Timer *timer_new(const struct audio_format *af)
timer = xmalloc(sizeof(Timer));
timer->time = 0;
timer->started = 0;
- timer->rate = af->sample_rate * (af->bits / CHAR_BIT) * af->channels;
+ timer->rate = af->sample_rate * audio_format_frame_size(af);
return timer;
}