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 903

Summary: Loading a sound file a second time fails
Product: SDL_mixer Reporter: macite
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 1.2.11   
Hardware: All   
OS: All   

Description macite 2009-12-14 13:50:08 UTC
In the new version of SDL mixer (at least on Mac and Windows) loading a ogg file (haven;t tested others) twice fails to load the sound effect the second time. The following code only plays the sound effect once, with the *se2 == null and no error reported by SDL:

    Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 2048 );
    //printf("%d\n", Mix_AllocateChannels(32));
    Mix_Chunk *se = Mix_LoadWAV("start.ogg");
    
    int ch = Mix_PlayChannel( -1, se, 0);
    
    Mix_Volume(ch, 128);
    while(Mix_Playing(ch) != 0)
    {
        SDL_Delay(100);
    }
    
    Mix_FreeChunk(se);
    
    Mix_Chunk *se2 = Mix_LoadWAV("start.ogg");
    ch = Mix_PlayChannel( -1, se2, 0);
    
    Mix_Volume(ch, 128);
    while(Mix_Playing(ch) != 0)
    {
        SDL_Delay(100);
    }
Comment 1 macite 2009-12-14 13:51:25 UTC
Corrected version of SDL_mixer in bug report. Also wanted to confirm that switching to the previous version of SDL mixer fixes this issue.
Comment 2 Sam Lantinga 2009-12-14 14:35:01 UTC
Can you uninstall SDL_mixer and re-install version 1.2.11 to confirm the problem?  This is the exact bug that was fixed by the 1.2.11 release.

Thanks!
Comment 3 macite 2009-12-15 17:08:36 UTC
Sorry, my mistake was still using 1.2.10. Have updated an works fine now.
Comment 4 Sam Lantinga 2009-12-15 18:16:37 UTC
Great, thanks for the update!