Skip to content

Commit

Permalink
Fixed music fading for Ogg Vorbis, libmad, and FLAC.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 20, 2017
1 parent e2e07cb commit 3be85c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion music_flac.c
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions music_mad.c
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions music_ogg.c
Expand Up @@ -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;
Expand Down

0 comments on commit 3be85c9

Please sign in to comment.