Skip to content

Commit

Permalink
Merge pull request #4495 from FernetMenta/aefixes
Browse files Browse the repository at this point in the history
WASAPI: add 192khz sample rate in case we added HD formats
  • Loading branch information
jmarshallnz authored and t-nelson committed Apr 3, 2014
1 parent 1028aca commit 4125e06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 4125e06

Please sign in to comment.