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

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1450 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
skidau 2015-05-19 11:50:56 +00:00
parent c058d1e6bb
commit a1880e0107
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];