aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
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.c
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 'src/audio.c')
-rw-r--r--src/audio.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/audio.c b/src/audio.c
index 7bec92437..839052dc2 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -66,14 +66,6 @@ static unsigned int audio_output_count(void)
return nr;
}
-int cmpAudioFormat(const struct audio_format *f1, const struct audio_format *f2)
-{
- if (f1 && f2 && (f1->sampleRate == f2->sampleRate) &&
- (f1->bits == f2->bits) && (f1->channels == f2->channels))
- return 0;
- return 1;
-}
-
/* make sure initPlayerData is called before this function!! */
void initAudioDriver(void)
{
@@ -230,13 +222,8 @@ void finishAudioDriver(void)
int isCurrentAudioFormat(const struct audio_format *audioFormat)
{
- if (!audioFormat)
- return 1;
-
- if (cmpAudioFormat(audioFormat, &audio_format) != 0)
- return 0;
-
- return 1;
+ return audioFormat == NULL ||
+ audio_format_equals(audioFormat, &audio_format);
}
static void syncAudioDeviceStates(void)