aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio_format.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-09 10:05:15 +0200
committerMax Kellermann <max@duempel.org>2008-09-09 10:05:15 +0200
commitbe9212ba84a43a1c7ce4c4dcf179bb9ef08929f7 (patch)
treebf06342ae83b5b2b960b6e9a1776c8c952ed1b8b /src/audio_format.h
parent7f1cccb3ea2c94d27b1964530405c953d474bfd0 (diff)
downloadmpd-be9212ba84a43a1c7ce4c4dcf179bb9ef08929f7.tar.gz
mpd-be9212ba84a43a1c7ce4c4dcf179bb9ef08929f7.tar.xz
mpd-be9212ba84a43a1c7ce4c4dcf179bb9ef08929f7.zip
audio: moved cmpAudioFormat() to audio_format.h
Rename it to audio_format_equals() and return "true" if they are equal.
Diffstat (limited to '')
-rw-r--r--src/audio_format.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/audio_format.h b/src/audio_format.h
index b4b40c69f..1cfb258ae 100644
--- a/src/audio_format.h
+++ b/src/audio_format.h
@@ -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;