audio: moved cmpAudioFormat() to audio_format.h

Rename it to audio_format_equals() and return "true" if they are
equal.
This commit is contained in:
Max Kellermann
2008-09-09 10:05:15 +02:00
parent 7f1cccb3ea
commit be9212ba84
5 changed files with 14 additions and 22 deletions

View File

@@ -27,6 +27,14 @@ struct audio_format {
mpd_sint8 channels;
};
static inline int audio_format_equals(const struct audio_format *a,
const struct audio_format *b)
{
return a->sampleRate == b->sampleRate &&
a->bits == b->bits &&
a->channels == b->channels;
}
static inline double audio_format_time_to_size(const struct audio_format *af)
{
return af->sampleRate * af->bits * af->channels / 8.0;