Merge pull request #2824 from moncefmechri/bugfix-6001
Use dummy audio backend if the selected backend fails to start
This commit is contained in:
commit
24f3312506
|
@ -65,15 +65,20 @@ namespace AudioCommon
|
||||||
if (g_sound_stream)
|
if (g_sound_stream)
|
||||||
{
|
{
|
||||||
UpdateSoundStream();
|
UpdateSoundStream();
|
||||||
if (g_sound_stream->Start())
|
if (!g_sound_stream->Start())
|
||||||
{
|
{
|
||||||
|
ERROR_LOG(AUDIO, "Could not start backend %s, using %s instead",
|
||||||
|
backend.c_str(), BACKEND_NULLSOUND);
|
||||||
|
delete g_sound_stream;
|
||||||
|
g_sound_stream = new NullSound();
|
||||||
|
g_sound_stream->Start();
|
||||||
|
}
|
||||||
|
|
||||||
if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start)
|
if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start)
|
||||||
StartAudioDump();
|
StartAudioDump();
|
||||||
|
|
||||||
return g_sound_stream;
|
return g_sound_stream;
|
||||||
}
|
}
|
||||||
PanicAlertT("Could not initialize backend %s.", backend.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
PanicAlertT("Sound backend %s is not valid.", backend.c_str());
|
PanicAlertT("Sound backend %s is not valid.", backend.c_str());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue