From 3be85c997ad907cd25da4dfa14ac4bc2c701a549 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 20 Jan 2017 02:23:51 -0500 Subject: [PATCH] Fixed music fading for Ogg Vorbis, libmad, and FLAC. --- music_flac.c | 2 +- music_mad.c | 4 ++-- music_ogg.c | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/music_flac.c b/music_flac.c index e48a41f7..8f490731 100644 --- a/music_flac.c +++ b/music_flac.c @@ -488,7 +488,7 @@ int FLAC_playAudio(FLAC_music *music, Uint8 *snd, int len) SDL_memcpy (snd, music->snd_available, mixable); } else { - SDL_MixAudio (snd, music->snd_available, mixable, music->volume); + SDL_MixAudioFormat(snd, music->snd_available, mixer.format, mixable, music->volume); } music->len_available -= mixable; music->snd_available += mixable; diff --git a/music_mad.c b/music_mad.c index 569a688e..3ba2f34b 100644 --- a/music_mad.c +++ b/music_mad.c @@ -264,8 +264,8 @@ mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len) { if (mp3_mad->volume == MIX_MAX_VOLUME) { SDL_memcpy(out, mp3_mad->output_buffer + mp3_mad->output_begin, num_bytes); } else { - SDL_MixAudio(out, mp3_mad->output_buffer + mp3_mad->output_begin, - num_bytes, mp3_mad->volume); + SDL_MixAudioFormat(out, mp3_mad->output_buffer + mp3_mad->output_begin, + mixer.format, num_bytes, mp3_mad->volume); } out += num_bytes; mp3_mad->output_begin += num_bytes; diff --git a/music_ogg.c b/music_ogg.c index a070bbbd..44e8925b 100644 --- a/music_ogg.c +++ b/music_ogg.c @@ -179,8 +179,7 @@ int OGG_playAudio(OGG_music *music, Uint8 *snd, int len) if ( music->volume == MIX_MAX_VOLUME ) { SDL_memcpy(snd, music->snd_available, mixable); } else { - SDL_MixAudio(snd, music->snd_available, mixable, - music->volume); + SDL_MixAudioFormat(snd, music->snd_available, mixer.format, mixable, music->volume); } music->len_available -= mixable; music->snd_available += mixable;