Help using Mix_OpenAudio and SDL_OpenAudio in same app

Hi, I am trying to finish up a school project for using SDL 1.2 right now. I am having some problems with audio.

First, I load audio for the menu screen using Mix_OpenAudio(), then Mix_CloseAudio.
I can open and close audio a bunch of times with this, and it still works fine.

The problem is, when I run my movie class, I get the error “Audio device is already open”.
this can’t be true, because skipping the movie and going between game and movie works fine.

The movie class uses the SDL_ffmpeg library, and opens audio with the function SDL_OpenAudio()
so that I can send the decoder output through the callback.

the most confusing part, is that the movie only fails the first time I try to load it. Any following attempt to load the movie succeeds, but alll the other audio stops working…

If anyone can help me diagnose this, it would be greatly appreciated. I am really lost on how to fix this problem.

Thanks for any help, Nick

I think that’s inadvisable to use Sdl_audio and sdl_mixer at the same time because from what I can tell, they both “take control” of the speaker, so if I were you, I’d just use the mixer, and don’t use Mix_CloseAudio until your program finishes. Just use Mix_HaltChannel and Mix_HaltMusic to stop your sounds, or Mix_PauseMusic and Mix_ResumeMusic for obvious purposes.