summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/WASAPIStream.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-10-21 13:32:25 -0400
committerLioncash <mathew1800@gmail.com>2020-10-21 13:32:28 -0400
commit22a79289d37bb48fcc5a7ff7944b02052340df0e (patch)
tree699c23e2b81354b06c40a823da27e6dc60760e8f /Source/Core/AudioCommon/WASAPIStream.cpp
parent09e87b79f19ce0fb06b236e15ebed414af57558a (diff)
AudioCommon: Migrate logging over to fmt
printf specifiers, begone!
Diffstat (limited to 'Source/Core/AudioCommon/WASAPIStream.cpp')
-rw-r--r--Source/Core/AudioCommon/WASAPIStream.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/AudioCommon/WASAPIStream.cpp b/Source/Core/AudioCommon/WASAPIStream.cpp
index 483a68f7af..6e6cd1950a 100644
--- a/Source/Core/AudioCommon/WASAPIStream.cpp
+++ b/Source/Core/AudioCommon/WASAPIStream.cpp
@@ -60,12 +60,12 @@ bool WASAPIStream::isValid()
return true;
}
-static bool HandleWinAPI(std::string message, HRESULT result)
+static bool HandleWinAPI(std::string_view message, HRESULT result)
{
if (result != S_OK)
{
_com_error err(result);
- std::string error = TStrToUTF8(err.ErrorMessage()).c_str();
+ std::string error = TStrToUTF8(err.ErrorMessage());
switch (result)
{
@@ -74,7 +74,7 @@ static bool HandleWinAPI(std::string message, HRESULT result)
break;
}
- ERROR_LOG(AUDIO, "WASAPI: %s: %s", message.c_str(), error.c_str());
+ ERROR_LOG_FMT(AUDIO, "WASAPI: {}: {}", message, error);
}
return result == S_OK;
@@ -236,8 +236,8 @@ bool WASAPIStream::SetRunning(bool running)
if (!device)
{
- ERROR_LOG(AUDIO, "Can't find device '%s', falling back to default",
- SConfig::GetInstance().sWASAPIDevice.c_str());
+ ERROR_LOG_FMT(AUDIO, "Can't find device '{}', falling back to default",
+ SConfig::GetInstance().sWASAPIDevice);
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device);
}
}
@@ -261,7 +261,7 @@ bool WASAPIStream::SetRunning(bool running)
device_properties->GetValue(PKEY_Device_FriendlyName, &device_name);
- INFO_LOG(AUDIO, "Using audio endpoint '%s'", TStrToUTF8(device_name.pwszVal).c_str());
+ INFO_LOG_FMT(AUDIO, "Using audio endpoint '{}'", TStrToUTF8(device_name.pwszVal));
PropVariantClear(&device_name);
@@ -280,7 +280,7 @@ bool WASAPIStream::SetRunning(bool running)
result = m_audio_client->GetDevicePeriod(nullptr, &device_period);
device_period += SConfig::GetInstance().iLatency * (10000 / m_format.Format.nChannels);
- INFO_LOG(AUDIO, "Audio period set to %d", device_period);
+ INFO_LOG_FMT(AUDIO, "Audio period set to {}", device_period);
if (!HandleWinAPI("Failed to obtain device period", result))
{
@@ -384,7 +384,7 @@ bool WASAPIStream::SetRunning(bool running)
device->Release();
- INFO_LOG(AUDIO, "WASAPI: Successfully initialized!");
+ INFO_LOG_FMT(AUDIO, "WASAPI: Successfully initialized!");
m_running = true;
m_thread = std::thread([this] { SoundLoop(); });