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:
@@ -61,9 +61,15 @@ static inline unsigned audio_format_sample_size(const struct audio_format *af)
|
||||
return 4;
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
audio_format_frame_size(const struct audio_format *af)
|
||||
{
|
||||
return audio_format_sample_size(af) * af->channels;
|
||||
}
|
||||
|
||||
static inline double audio_format_time_to_size(const struct audio_format *af)
|
||||
{
|
||||
return af->sample_rate * af->channels * audio_format_sample_size(af);
|
||||
return af->sample_rate * audio_format_frame_size(af);
|
||||
}
|
||||
|
||||
static inline double audioFormatSizeToTime(const struct audio_format *af)
|
||||
|
Reference in New Issue
Block a user