From be9212ba84a43a1c7ce4c4dcf179bb9ef08929f7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 9 Sep 2008 10:05:15 +0200 Subject: audio: moved cmpAudioFormat() to audio_format.h Rename it to audio_format_equals() and return "true" if they are equal. --- src/audio.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/audio.c') 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) -- cgit v1.2.3