From 96155a3376ef40eac9ca7a7b882da6447ab53979 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Oct 2008 14:41:37 +0200 Subject: 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). --- src/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/audio.c') diff --git a/src/audio.c b/src/audio.c index a4d4e3ea..353f8b8d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -315,7 +315,7 @@ static int flushAudioBuffer(void) static size_t audio_buffer_size(const struct audio_format *af) { - return (af->bits >> 3) * af->channels * (af->sample_rate >> 5); + return audio_format_frame_size(af) * (af->sample_rate >> 5); } static void audio_buffer_resize(size_t size) -- cgit v1.2.3