Skip to content

Commit

Permalink
Fixed bug #119
Browse files Browse the repository at this point in the history
if a Mixer has already been opened with paramter set A and I try to open
another one with parameter set B, Mix_OpenAudio will happily say "you
already opened audio with parameter set B, go ahead",  which is wrong.

Regards, Andreas
  • Loading branch information
slouken committed May 1, 2006
1 parent cfb9a02 commit 149daea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mixer.c
Expand Up @@ -275,8 +275,13 @@ int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)

/* If the mixer is already opened, increment open count */
if ( audio_opened ) {
++audio_opened;
return(0);
if ( format == mixer.format && nchannels == mixer.channels ) {
++audio_opened;
return(0);
}
while ( audio_opened ) {
Mix_CloseAudio();
}
}

/* Set the desired format and frequency */
Expand Down

0 comments on commit 149daea

Please sign in to comment.