Re: [PATCH v2 0/2] MR5734: mf: Implement audio capture device enumeration in MFEnumDeviceSources().
Nikolay Sivov (@nsivov) commented about dlls/mf/sac.c:
+ + hr = IMMDevice_OpenPropertyStore(device, STGM_READ, &ps); + IMMDevice_Release(device); + if (FAILED(hr)) + goto done; + hr = IPropertyStore_GetValue(ps, (const PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &pv); + IPropertyStore_Release(ps); + if (FAILED(hr)) + goto done; + if (pv.vt != VT_LPWSTR) + { + PropVariantClear(&pv); + goto done; + } + IMFActivate_SetString(sources[i], &MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, pv.pwszVal); + PropVariantClear(&pv); I think cascading checks for hr are better here than multiple jumps. And if property store becomes useful for instance id, we could have a helper that checks value types.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5734#note_71440
participants (1)
-
Nikolay Sivov (@nsivov)