added inline function audio_format_time_to_size()
Make the code more readable by hiding big formulas in an inline function with a nice name.
This commit is contained in:
@@ -27,6 +27,11 @@ typedef struct _AudioFormat {
|
||||
volatile mpd_sint8 bits;
|
||||
} AudioFormat;
|
||||
|
||||
static inline double audio_format_time_to_size(const AudioFormat * af)
|
||||
{
|
||||
return af->sampleRate * af->bits * af->channels / 8.0;
|
||||
}
|
||||
|
||||
static inline double audioFormatSizeToTime(const AudioFormat * af)
|
||||
{
|
||||
return 8.0 / af->bits / af->channels / af->sampleRate;
|
||||
|
Reference in New Issue
Block a user