1
0
Fork 0

Show error information when unable to open audio device.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@840
This commit is contained in:
Sjoerd van der Berg 2003-03-30 10:50:20 +00:00
parent 0988c1e4dc
commit c7f8376088

View file

@ -332,10 +332,14 @@ void MIXER_Init(Section* sec) {
spec.samples=mixer.blocksize;
mixer.tick_remain=0;
if (mixer.nosound || (SDL_OpenAudio(&spec, &obtained) < 0 )) {
if (mixer.nosound) {
LOG_MSG("MIXER:No Sound Mode Selected.");
mixer.tick_add=((mixer.freq) << MIXER_SHIFT)/1000;
TIMER_RegisterTickHandler(MIXER_Mix_NoSound);
} else if (SDL_OpenAudio(&spec, &obtained) <0 ) {
LOG_MSG("MIXER:Can't open audio: %s , running in nosound mode.",SDL_GetError());
mixer.tick_add=((mixer.freq) << MIXER_SHIFT)/1000;
TIMER_RegisterTickHandler(MIXER_Mix_NoSound);
LOG_MSG("MIXER:Running in nosound mode.");
} else {
mixer.freq=obtained.freq;
mixer.blocksize=obtained.samples;