From 2a388c2aa7c414b525c95de9b81a837b8da54ea7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Feb 2009 18:51:29 +0100 Subject: crossfade: don't use isCurrentAudioFormat() The crossfading code shouldn't depend on the audio output code. Pass the current audio format to cross_fade_calc() and let it compare directly, instead of using isCurrentAudioFormat(). --- src/crossfade.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/crossfade.c') diff --git a/src/crossfade.c b/src/crossfade.c index a21b05fa2..fb3515fc4 100644 --- a/src/crossfade.c +++ b/src/crossfade.c @@ -18,7 +18,6 @@ */ #include "crossfade.h" -#include "audio.h" #include "pcm_mix.h" #include "pipe.h" #include "audio_format.h" @@ -29,12 +28,14 @@ unsigned cross_fade_calc(float duration, float total_time, const struct audio_format *af, + const struct audio_format *old_format, unsigned max_chunks) { unsigned int chunks; if (duration <= 0 || duration >= total_time || - !isCurrentAudioFormat(af)) + /* we can't crossfade when the audio formats are different */ + !audio_format_equals(af, old_format)) return 0; assert(duration > 0); -- cgit v1.2.3