Merge pull request #21 from retro-wertz/gtk_audio_silence

gtk: fix audio going on/off when entering Sound Config option
This commit is contained in:
zeromus 2019-02-02 04:00:07 -05:00 committed by GitHub
commit f14321113a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1330,8 +1330,10 @@ void toggleSound(GtkWidget* check, gpointer data)
{ {
if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check)))
{ {
int last_soundopt;
g_config->getOption("SDL.Sound", &last_soundopt);
g_config->setOption("SDL.Sound", 1); g_config->setOption("SDL.Sound", 1);
if(GameInfo) if(GameInfo && !last_soundopt)
InitSound(); InitSound();
} }
else else