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 - "unexpected behaviour" in Mix_OpenAudio
Summary: "unexpected behaviour" in Mix_OpenAudio
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-31 09:18 UTC by Sam Lantinga
Modified: 2006-04-30 23:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!