Skip to content

Commit

Permalink
Revert to a default audio api (SDL) when config is invalid
Browse files Browse the repository at this point in the history
Prevents crash when an invalid or a non existing api is used in
vbam.conf
  • Loading branch information
retro-wertz committed Dec 23, 2018
1 parent 0d1b23c commit 0c579b2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/wx/opts.cpp
Expand Up @@ -254,10 +254,18 @@ opt_desc opts[] = {
INTOPT("preferences/vsync", "VSync", wxTRANSLATE("Wait for vertical sync"), vsync, 0, 1),

/// Sound
#ifdef __WXMSW__
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|xaudio2")),
#ifdef NO_OAL
#ifdef __WXMSW__
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdldirectsound|xaudio2")),
#else
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl")),
#endif
#else
#ifdef __WXMSW__
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|xaudio2")),
#else
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal")),
#endif
#endif
INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10),
INTOPT("Sound/Enable", "", wxTRANSLATE("Bit mask of sound channels to enable"), gopts.sound_en, 0, 0x30f),
Expand Down

0 comments on commit 0c579b2

Please sign in to comment.