Skip to content
This repository was archived by the owner on Feb 20, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion KCBv2/KCBSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ HRESULT KCBSensor::GetAudioBuffer(ULONG cb, _Out_writes_bytes_to_(cb, *pcbRead)
SAFE_RELEASE(pAudioBeam);
}

CHECK_HR(hr = m_pAudioStream->Read((void *)cbBuffer, sizeof(cb), pcbRead));
CHECK_HR(hr = m_pAudioStream->Read((void *)cbBuffer, cb, pcbRead));

if (*pcbRead > 0)
{
Expand Down
16 changes: 13 additions & 3 deletions KCBv2/KCBv2Lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,27 @@ HRESULT FindAudioDevice(const WCHAR* wsName, IAudioClient** ppClient)
// Each loop until we find the Kinect USB Audio device
for (ULONG i = 0; i < count; ++i)
{
CHECK_HR(hr = pCollection->Item(i, &pEndpoint));
hr = pCollection->Item(i, &pEndpoint);
if (!SUCCEEDED(hr)) {
continue;
}

// get the property store from the device
CHECK_HR(hr = pEndpoint->OpenPropertyStore(STGM_READ, &pProps));
hr = pEndpoint->OpenPropertyStore(STGM_READ, &pProps);
if (!SUCCEEDED(hr)) {
continue;
}

// Initialize container for property value.
PROPVARIANT varName;
PropVariantInit(&varName);

// Get the endpoint's friendly-name property.
CHECK_HR(hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName));
hr = pProps->GetValue(PKEY_Device_FriendlyName, &varName);

if (!SUCCEEDED(hr)) {
continue;
}

// get the name from the property store
name = varName.pwszVal;
Expand Down