From 4125e06d27f073b3fa199d1b3a05df4aeb6289c7 Mon Sep 17 00:00:00 2001 From: jmarshallnz Date: Tue, 1 Apr 2014 07:43:46 +1300 Subject: [PATCH] Merge pull request #4495 from FernetMenta/aefixes WASAPI: add 192khz sample rate in case we added HD formats --- xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp index ccec98d7dd892..e895dd21450d9 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp @@ -545,6 +545,7 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bool fo CAEChannelInfo deviceChannels; LPWSTR pwszID = NULL; std::wstring wstrDDID; + bool add192 = false; WAVEFORMATEXTENSIBLE wfxex = {0}; HRESULT hr; @@ -677,6 +678,7 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bool fo CLog::Log(LOGNOTICE, __FUNCTION__": data format \"%s\" on device \"%s\" seems to be not supported.", CAEUtil::DataFormatToStr(AE_FMT_DTSHD), strFriendlyName.c_str()); deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_DTSHD)); + add192 = true; } /* Test format Dolby TrueHD */ @@ -688,6 +690,7 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bool fo CLog::Log(LOGNOTICE, __FUNCTION__": data format \"%s\" on device \"%s\" seems to be not supported.", CAEUtil::DataFormatToStr(AE_FMT_TRUEHD), strFriendlyName.c_str()); deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_TRUEHD)); + add192 = true; } /* Test format Dolby EAC3 */ @@ -702,6 +705,7 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bool fo CLog::Log(LOGNOTICE, __FUNCTION__": data format \"%s\" on device \"%s\" seems to be not supported.", CAEUtil::DataFormatToStr(AE_FMT_EAC3), strFriendlyName.c_str()); deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_EAC3)); + add192 = true; } /* Test format DTS */ @@ -786,6 +790,11 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bool fo hr = pClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &wfxex.Format, NULL); if (SUCCEEDED(hr)) deviceInfo.m_sampleRates.push_back(WASAPISampleRates[j]); + else if (wfxex.Format.nSamplesPerSec == 192000 && add192) + { + deviceInfo.m_sampleRates.push_back(WASAPISampleRates[j]); + CLog::Log(LOGNOTICE, __FUNCTION__": sample rate 192khz on device \"%s\" seems to be not supported.", strFriendlyName.c_str()); + } } /* Test format for channels iteration */