Fixing problem where the music overwrites the already mixed audio
authorSam Lantinga
Mon, 08 Nov 1999 22:24:31 +0000
changeset 157463b2125f11
parent 14 2500ac56c440
child 16 ada544ec16c6
Fixing problem where the music overwrites the already mixed audio
mixer.c
     1.1 --- a/mixer.c	Mon Nov 01 00:54:20 1999 +0000
     1.2 +++ b/mixer.c	Mon Nov 08 22:24:31 1999 +0000
     1.3 @@ -70,6 +70,11 @@
     1.4  	int i, mixable, volume;
     1.5  	Uint32 sdl_ticks;
     1.6  
     1.7 +	/* Mix the music (must be done before the channels are added) */
     1.8 +	if ( music_active ) {
     1.9 +		mix_music(music_data, stream, len);
    1.10 +	}
    1.11 +
    1.12  	/* Grab the channels we need to mix */
    1.13  	SDL_mutexP(mixer_lock);
    1.14  	mixed_channels = 0;
    1.15 @@ -120,11 +125,6 @@
    1.16  		}
    1.17  	}
    1.18  	SDL_mutexV(mixer_lock);
    1.19 -
    1.20 -	/* Mix the music */
    1.21 -	if ( music_active ) {
    1.22 -		mix_music(music_data, stream, len);
    1.23 -	}
    1.24  }
    1.25  
    1.26  static void PrintFormat(char *title, SDL_AudioSpec *fmt)