Permalink
Browse files

[AE] WASAPI: Try to enumerate more sample rates

  • Loading branch information...
Karlson2k committed Oct 9, 2012
1 parent 831ec75 commit 1837a50a10268608266771718781e5f71ec64e5a
Showing with 3 additions and 6 deletions.
  1. +3 −6 xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp
@@ -46,9 +46,6 @@ const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
const IID IID_IAudioClient = __uuidof(IAudioClient);
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
-static const unsigned int WASAPISampleRateCount = 10;
-static const unsigned int WASAPISampleRates[] = {384000, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 22050, 11025};
-
static const unsigned int WASAPITestSampleRates[] = {11025, 12000, 16000,
22050, 24000, 32000,
44100, 48000, 64000,
@@ -792,13 +789,13 @@ void CAESinkWASAPI::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList)
wfxex.Format.nBlockAlign = wfxex.Format.nChannels * (wfxex.Format.wBitsPerSample >> 3);
wfxex.Format.nAvgBytesPerSec = wfxex.Format.nSamplesPerSec * wfxex.Format.nBlockAlign;
- for (int j = 0; j < WASAPISampleRateCount; j++)
+ for (int j = 0; j <= WASAPITestSampleRatesMaxIndex; j++)
{
- wfxex.Format.nSamplesPerSec = WASAPISampleRates[j];
+ wfxex.Format.nSamplesPerSec = WASAPITestSampleRates[j];
wfxex.Format.nAvgBytesPerSec = wfxex.Format.nSamplesPerSec * wfxex.Format.nBlockAlign;
hr = pClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE, &wfxex.Format, NULL);
if (SUCCEEDED(hr))
- deviceInfo.m_sampleRates.push_back(WASAPISampleRates[j]);
+ deviceInfo.m_sampleRates.push_back(WASAPITestSampleRates[j]);
}
/* Test format for channels iteration */

0 comments on commit 1837a50

Please sign in to comment.