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).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user