Skip to content

Commit

Permalink
Fixing problem where the music overwrites the already mixed audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Lantinga committed Nov 8, 1999
1 parent 152e6c7 commit 2b4ba31
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mixer.c
Expand Up @@ -70,6 +70,11 @@ static void mix_channels(void *udata, Uint8 *stream, int len)
int i, mixable, volume;
Uint32 sdl_ticks;

/* Mix the music (must be done before the channels are added) */
if ( music_active ) {
mix_music(music_data, stream, len);
}

/* Grab the channels we need to mix */
SDL_mutexP(mixer_lock);
mixed_channels = 0;
Expand Down Expand Up @@ -120,11 +125,6 @@ static void mix_channels(void *udata, Uint8 *stream, int len)
}
}
SDL_mutexV(mixer_lock);

/* Mix the music */
if ( music_active ) {
mix_music(music_data, stream, len);
}
}

static void PrintFormat(char *title, SDL_AudioSpec *fmt)
Expand Down

0 comments on commit 2b4ba31

Please sign in to comment.