"unexpected behaviour" in Mix_OpenAudio

Hi list!

I am having problems with doom-legacy for SDL. The music plays nicely
but the sfx are playing much too fast/high-pitched: sampling rate
mismatch…
When I looked into the source to find the cause of it, I found something
that might introduce the error but at least hides bugs in SDL-using
programs/games:

in Mix_OpenAudio:-----------------------------
/* Open the mixer with a certain desired audio format */
int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int
chunksize)
{
int i;
SDL_AudioSpec desired;

    /* If the mixer is already opened, increment open count */
    if ( audio_opened ) {
        ++audio_opened;
        return(0);
    }

(…)

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