Skip to content

Commit

Permalink
Don't allow device format changes in Mix_OpenAudio().
Browse files Browse the repository at this point in the history
This tends to cause problems when you get a float32 format on WASAPI or
CoreAudio but expected Sint16. This change is only for the legacy API: if you
want more control here, use Mix_OpenAudioDevice() instead.
  • Loading branch information
icculus committed Oct 11, 2017
1 parent 02d248a commit aef1f56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mixer.c
Expand Up @@ -518,8 +518,9 @@ int Mix_OpenAudioDevice(int frequency, Uint16 format, int nchannels, int chunksi
/* Open the mixer with a certain desired audio format */
int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)
{
return Mix_OpenAudioDevice(frequency, format, nchannels, chunksize,
NULL, SDL_AUDIO_ALLOW_ANY_CHANGE);
return Mix_OpenAudioDevice(frequency, format, nchannels, chunksize, NULL,
SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
SDL_AUDIO_ALLOW_CHANNELS_CHANGE);
}

/* Dynamically change the number of channels managed by the mixer.
Expand Down

0 comments on commit aef1f56

Please sign in to comment.