Skip to content

Commit

Permalink
SPU: Move device failure message to OSD
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jan 24, 2025
1 parent 9666abc commit 573b2eb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/spu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "common/log.h"
#include "common/path.h"

#include "IconsEmoji.h"
#include "fmt/format.h"

#include <memory>
Expand Down Expand Up @@ -482,10 +483,13 @@ void SPU::CreateOutputStream()
g_settings.audio_driver.c_str(), g_settings.audio_output_device.c_str(), &error);
if (!s_state.audio_stream)
{
Host::ReportErrorAsync(
"Error",
fmt::format("Failed to create or configure audio stream, falling back to null output. The error was:\n{}",
error.GetDescription()));
Host::AddIconOSDWarning(
"SPUAudioStream", ICON_EMOJI_WARNING,
fmt::format(
TRANSLATE_FS("SPU",
"Failed to create or configure audio stream, falling back to null output. The error was:\n{}"),
error.GetDescription()),
Host::OSD_ERROR_DURATION);
s_state.audio_stream.reset();
s_state.audio_stream = AudioStream::CreateNullStream(SAMPLE_RATE, g_settings.audio_stream_parameters.buffer_ms);
}
Expand Down

0 comments on commit 573b2eb

Please sign in to comment.