Skip to content

Commit

Permalink
[WIN32] fixed: it shouldn't happen but according to some crash dumps …
Browse files Browse the repository at this point in the history
…varName doesn't contain a WAVEFORMATEX even though the return status is S_OK.
  • Loading branch information
WiSo committed Jul 27, 2012
1 parent 07ae1d6 commit 9ff141a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp
Expand Up @@ -588,13 +588,13 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList)
IAudioClient *pClient;
hr = pDevice->Activate(IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&pClient);
if (FAILED(hr))
{
CLog::Log(LOGERROR, __FUNCTION__": Activate device failed (%s)", WASAPIErrToStr(hr));
}
{
CLog::Log(LOGERROR, __FUNCTION__": Activate device failed (%s)", WASAPIErrToStr(hr));
}

//hr = pClient->GetMixFormat(&pwfxex);
hr = pProperty->GetValue(PKEY_AudioEngine_DeviceFormat, &varName);
if (SUCCEEDED(hr))
if (SUCCEEDED(hr) && varName.blob.cbSize > 0)
{
WAVEFORMATEX* smpwfxex = (WAVEFORMATEX*)varName.blob.pBlobData;
deviceInfo.m_channels = layoutsByChCount[std::min(smpwfxex->nChannels, (WORD) 2)];
Expand All @@ -604,7 +604,7 @@ void CAESinkDirectSound::EnumerateDevicesEx(AEDeviceInfoList &deviceInfoList)
}
else
{
CLog::Log(LOGERROR, __FUNCTION__": GetMixFormat failed (%s)", WASAPIErrToStr(hr));
CLog::Log(LOGERROR, __FUNCTION__": Getting DeviceFormat failed (%s)", WASAPIErrToStr(hr));
}
pClient->Release();

Expand Down

0 comments on commit 9ff141a

Please sign in to comment.