From 646260b19e2084bb3d81986929cc8fa0291068e5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:14:09 +0000 Subject: moved expression to audioFormatSizeToTime() The multi-line expression which calculates sizeToTime is hard to read, partly because "cb->audioFormat." is too long. Create a separate inline function in audio.h for that. git-svn-id: https://svn.musicpd.org/mpd/trunk@7277 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/audio.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/audio.h') diff --git a/src/audio.h b/src/audio.h index 548beb806..ef0f211c2 100644 --- a/src/audio.h +++ b/src/audio.h @@ -35,6 +35,11 @@ typedef struct _AudioFormat { unsigned int audio_device_count(void); +static inline double audioFormatSizeToTime(const AudioFormat * af) +{ + return 8.0 / af->bits / af->channels / af->sampleRate; +} + void copyAudioFormat(AudioFormat * dest, AudioFormat * src); int cmpAudioFormat(AudioFormat * dest, AudioFormat * src); -- cgit v1.2.3