Skip to content
This repository
Browse code

[WIN32][AE] fixed: supported channels should be between 2 and 8

  • Loading branch information...
commit 5f56b22502bd8887561d966e44276b008ef69022 1 parent c7d89b0
wsoltys authored February 14, 2013
2  xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
@@ -603,7 +603,7 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList, bo
603 603
     if (SUCCEEDED(hr) && varName.blob.cbSize > 0)
604 604
     {
605 605
       WAVEFORMATEX* smpwfxex = (WAVEFORMATEX*)varName.blob.pBlobData;
606  
-      deviceInfo.m_channels = layoutsByChCount[std::min(smpwfxex->nChannels, (WORD) 8)];
  606
+      deviceInfo.m_channels = layoutsByChCount[std::max(std::min(smpwfxex->nChannels, (WORD) 8), (WORD) 2)];
607 607
       deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_FLOAT));
608 608
       deviceInfo.m_dataFormats.push_back(AEDataFormat(AE_FMT_AC3));
609 609
       deviceInfo.m_sampleRates.push_back(std::min(smpwfxex->nSamplesPerSec, (DWORD) 192000));

0 notes on commit 5f56b22

Please sign in to comment.
Something went wrong with that request. Please try again.