mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Windows: Improve reporting of WASAPI errors.
This commit is contained in:
parent
8fa24045b1
commit
1b5e5e2556
1 changed files with 8 additions and 3 deletions
|
@ -366,13 +366,16 @@ bool WASAPIAudioThread::DetectFormat() {
|
|||
CoTaskMemFree(deviceFormat_);
|
||||
deviceFormat_ = closest;
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(badfallbackclosest, SCEAUDIO, "WASAPI fallback and closest unsupported");
|
||||
wchar_t guid[256]{};
|
||||
StringFromGUID2(closest->SubFormat, guid, 256);
|
||||
ERROR_LOG_REPORT_ONCE(badfallbackclosest, SCEAUDIO, "WASAPI fallback and closest unsupported (fmt=%04x/%s)", closest->Format.wFormatTag, guid);
|
||||
CoTaskMemFree(closest);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
CoTaskMemFree(closest);
|
||||
ERROR_LOG_REPORT_ONCE(badfallback, SCEAUDIO, "WASAPI fallback format was unsupported");
|
||||
if (hr != AUDCLNT_E_DEVICE_INVALIDATED && hr != AUDCLNT_E_SERVICE_NOT_RUNNING)
|
||||
ERROR_LOG_REPORT_ONCE(badfallback, SCEAUDIO, "WASAPI fallback format was unsupported (%08x)", hr);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -390,7 +393,9 @@ bool WASAPIAudioThread::ValidateFormat(const WAVEFORMATEXTENSIBLE *fmt) {
|
|||
if (fmt->Format.nChannels >= 1)
|
||||
format_ = Format::IEEE_FLOAT;
|
||||
} else {
|
||||
ERROR_LOG_REPORT_ONCE(unexpectedformat, SCEAUDIO, "Got unexpected WASAPI 0xFFFE stream format, expected float!");
|
||||
wchar_t guid[256]{};
|
||||
StringFromGUID2(fmt->SubFormat, guid, 256);
|
||||
ERROR_LOG_REPORT_ONCE(unexpectedformat, SCEAUDIO, "Got unexpected WASAPI 0xFFFE stream format (%S), expected float!", guid);
|
||||
if (fmt->Format.wBitsPerSample == 16 && fmt->Format.nChannels == 2) {
|
||||
format_ = Format::PCM16;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue