Skip to content

Commit

Permalink
do not crash on toggling mute state if no audio plugin is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Jani Monoses authored and alexp-sssup committed Apr 22, 2011
1 parent 607044a commit dd4326f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backends/input.cpp
Expand Up @@ -93,6 +93,8 @@ gboolean InputThread::gtkplug_worker(GtkWidget *widget, GdkEvent *event, InputTh
th->m_sys->showProfilingData=!th->m_sys->showProfilingData;
break;
case GDK_m:
if (!th->m_sys->audioManager->pluginLoaded())
break;
th->m_sys->audioManager->toggleMuteAll();
if(th->m_sys->audioManager->allMuted())
LOG(LOG_NO_INFO, "All sounds muted");
Expand Down Expand Up @@ -226,6 +228,8 @@ void* InputThread::sdl_worker(InputThread* th)
th->m_sys->showProfilingData=!th->m_sys->showProfilingData;
break;
case SDLK_m:
if (!th->m_sys->audioManager->pluginLoaded())
break;
th->m_sys->audioManager->toggleMuteAll();
if(th->m_sys->audioManager->allMuted())
LOG(LOG_NO_INFO, "All sounds muted");
Expand Down

0 comments on commit dd4326f

Please sign in to comment.