Skip to content

Commit

Permalink
Don't set the mixing callback until we've initialized our channels
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 4, 2024
1 parent 3a272cd commit 6d5c7a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,6 @@ bool Mix_OpenAudio(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec)
return false;
}

SDL_BindAudioStream(audio_device, audio_stream);
SDL_SetAudioStreamGetCallback(audio_stream, mix_channels, NULL);

#if 0
PrintFormat("Audio device", &mixer);
#endif
Expand Down Expand Up @@ -552,6 +549,9 @@ bool Mix_OpenAudio(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec)
/* Initialize the music players */
open_music(&mixer);

SDL_BindAudioStream(audio_device, audio_stream);
SDL_SetAudioStreamGetCallback(audio_stream, mix_channels, NULL);

audio_opened = 1;
return true;
}
Expand Down

0 comments on commit 6d5c7a6

Please sign in to comment.