libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
194 stars 40 forks source link

Better handling of audio+cdrom device opening #202

Closed icculus closed 2 years ago

icculus commented 2 years ago

I'm thinking, though, whether this works now or not, it might be better to always open the audio device at CD-ROM quality if the app asks for less, so there's never a scenario where you have to close the audio device and reopen it to accommodate things. You just have to make sure the SDL_AudioStream manages conversion, which we already have to do anyhow.

This would eliminate the gap in audio you hear in that patched loopwave.c, where it has to dump the audio device after 5 seconds to handle CD playback, and also a FIXME that I handwaved away about what to do if the reopening fails and something that was working fine is now screwed.

Originally posted by @icculus in https://github.com/libsdl-org/sdl12-compat/issues/176#issuecomment-1235604334