From 3f78d74fc111c7633d06b302aa154e3433b926d8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 9 Aug 2015 21:36:00 -0400 Subject: AudioCommon: Log to AUDIO, not DSPHLE This code is not related to DSPHLE. --- Source/Core/AudioCommon/AudioCommon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/AudioCommon/AudioCommon.cpp') diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index f5438faca9..5e7005cad1 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -57,7 +57,7 @@ namespace AudioCommon if (!g_sound_stream && NullSound::isValid()) { - WARN_LOG(DSPHLE, "Could not initialize backend %s, using %s instead.", + WARN_LOG(AUDIO, "Could not initialize backend %s, using %s instead.", backend.c_str(), BACKEND_NULLSOUND); g_sound_stream = new NullSound(); } @@ -84,7 +84,7 @@ namespace AudioCommon void ShutdownSoundStream() { - INFO_LOG(DSPHLE, "Shutting down sound stream"); + INFO_LOG(AUDIO, "Shutting down sound stream"); if (g_sound_stream) { @@ -95,7 +95,7 @@ namespace AudioCommon g_sound_stream = nullptr; } - INFO_LOG(DSPHLE, "Done shutting down sound stream"); + INFO_LOG(AUDIO, "Done shutting down sound stream"); } std::vector GetSoundBackends() -- cgit v1.2.3 From 8b767a1189f974d290ce90bf433d762a18da8961 Mon Sep 17 00:00:00 2001 From: Moncef Mechri Date: Sun, 9 Aug 2015 23:06:26 +0200 Subject: Use dummy audio backend if the selected backend fails to start If the selected audio backend fails to Start() (which could happen for example if there is no audio device), we currently still use the backend anyway. This can lead to crashes on some platforms (such as Windows) and is outright wrong anyway. This commit fallbacks to the Null audio backend if the selected backend couldn't be started. This fixes bug #6001 --- Source/Core/AudioCommon/AudioCommon.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Source/Core/AudioCommon/AudioCommon.cpp') diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index f5438faca9..19b6cc0e89 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -65,14 +65,19 @@ namespace AudioCommon if (g_sound_stream) { UpdateSoundStream(); - if (g_sound_stream->Start()) + if (!g_sound_stream->Start()) { - if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start) - StartAudioDump(); - - return g_sound_stream; + 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(); } - PanicAlertT("Could not initialize backend %s.", backend.c_str()); + + if (SConfig::GetInstance().m_DumpAudio && !s_audio_dump_start) + StartAudioDump(); + + return g_sound_stream; } PanicAlertT("Sound backend %s is not valid.", backend.c_str()); -- cgit v1.2.3 From cc036ca86cdaf709e01221975da734cb64d54a94 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Sep 2015 17:13:07 -0400 Subject: Common: Remove other Common prefixed headers from Common.h --- Source/Core/AudioCommon/AudioCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/AudioCommon/AudioCommon.cpp') diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index a24c7a196c..b4f2dae2f0 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -14,9 +14,9 @@ #include "AudioCommon/PulseAudioStream.h" #include "AudioCommon/XAudio2_7Stream.h" #include "AudioCommon/XAudio2Stream.h" - #include "Common/FileUtil.h" - +#include "Common/MsgHandler.h" +#include "Common/Logging/Log.h" #include "Core/ConfigManager.h" #include "Core/Movie.h" -- cgit v1.2.3