Reset the sound subsystem if the audio backend is changed. Fixed an array out of bounds error in the sound device selection.

This commit is contained in:
skidau 2015-05-19 11:50:56 +00:00
parent c39716f183
commit a79f006cf4
2 changed files with 2 additions and 1 deletions

View File

@ -2462,6 +2462,7 @@ EVT_HANDLER_MASK(SoundConfigure, "Sound options...", CMDEN_NREC_ANY)
soundSetVolume((float)gopts.sound_vol / 100.0);
update_opts();
soundReset();
}
EVT_HANDLER(EmulatorDirectories, "Directories...")

View File

@ -1704,7 +1704,7 @@ public:
SoundConfig_t &sch = sound_config_handler;
int devs = sch.dev->GetSelection();
if (!devs)
if (devs <= 0)
gopts.audio_dev = wxEmptyString;
else
gopts.audio_dev = sch.dev_ids[devs - 1];