Fixed music fading for Ogg Vorbis, libmad, and FLAC.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 20 Jan 2017 02:23:51 -0500
changeset 726298d69a81cc9
parent 725 bdf7b8d20566
child 727 119df1a05eb7
Fixed music fading for Ogg Vorbis, libmad, and FLAC.
music_flac.c
music_mad.c
music_ogg.c
     1.1 --- a/music_flac.c	Sun Jan 01 18:50:09 2017 -0800
     1.2 +++ b/music_flac.c	Fri Jan 20 02:23:51 2017 -0500
     1.3 @@ -488,7 +488,7 @@
     1.4              SDL_memcpy (snd, music->snd_available, mixable);
     1.5          }
     1.6          else {
     1.7 -            SDL_MixAudio (snd, music->snd_available, mixable, music->volume);
     1.8 +            SDL_MixAudioFormat(snd, music->snd_available, mixer.format, mixable, music->volume);
     1.9          }
    1.10          music->len_available -= mixable;
    1.11          music->snd_available += mixable;
     2.1 --- a/music_mad.c	Sun Jan 01 18:50:09 2017 -0800
     2.2 +++ b/music_mad.c	Fri Jan 20 02:23:51 2017 -0500
     2.3 @@ -264,8 +264,8 @@
     2.4      if (mp3_mad->volume == MIX_MAX_VOLUME) {
     2.5        SDL_memcpy(out, mp3_mad->output_buffer + mp3_mad->output_begin, num_bytes);
     2.6      } else {
     2.7 -      SDL_MixAudio(out, mp3_mad->output_buffer + mp3_mad->output_begin,
     2.8 -                   num_bytes, mp3_mad->volume);
     2.9 +      SDL_MixAudioFormat(out, mp3_mad->output_buffer + mp3_mad->output_begin,
    2.10 +                         mixer.format, num_bytes, mp3_mad->volume);
    2.11      }
    2.12      out += num_bytes;
    2.13      mp3_mad->output_begin += num_bytes;
     3.1 --- a/music_ogg.c	Sun Jan 01 18:50:09 2017 -0800
     3.2 +++ b/music_ogg.c	Fri Jan 20 02:23:51 2017 -0500
     3.3 @@ -179,8 +179,7 @@
     3.4          if ( music->volume == MIX_MAX_VOLUME ) {
     3.5              SDL_memcpy(snd, music->snd_available, mixable);
     3.6          } else {
     3.7 -            SDL_MixAudio(snd, music->snd_available, mixable,
     3.8 -                                          music->volume);
     3.9 +            SDL_MixAudioFormat(snd, music->snd_available, mixer.format, mixable, music->volume);
    3.10          }
    3.11          music->len_available -= mixable;
    3.12          music->snd_available += mixable;