We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 119

Summary: "unexpected behaviour" in Mix_OpenAudio
Product: SDL_mixer Reporter: Sam Lantinga <slouken>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   

Description Sam Lantinga 2006-01-31 09:18:34 UTC
Date: Mon, 07 Mar 2005 23:41:22 +0100
From: Andreas Hartmetz <ahartmetz@web.de>
Subject: [SDL] "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
Comment 1 Sam Lantinga 2006-04-30 23:35:20 UTC
This is fixed in subversion, thanks!