Ignore unnamed audio devices on enumeration
This was crashing trying to assign a nil CFStringRef from mystery audio devices to the NSString passed to the enumerate block function, which was predictably crashing. Ignore such devices instead. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
ab512e5086
commit
54f46d6380
|
@ -68,6 +68,9 @@
|
||||||
propsize = sizeof(name);
|
propsize = sizeof(name);
|
||||||
theAddress.mSelector = kAudioDevicePropertyDeviceNameCFString;
|
theAddress.mSelector = kAudioDevicePropertyDeviceNameCFString;
|
||||||
__Verify_noErr(AudioObjectGetPropertyData(devids[i], &theAddress, 0, NULL, &propsize, &name));
|
__Verify_noErr(AudioObjectGetPropertyData(devids[i], &theAddress, 0, NULL, &propsize, &name));
|
||||||
|
if(!name) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
propsize = 0;
|
propsize = 0;
|
||||||
theAddress.mSelector = kAudioDevicePropertyStreamConfiguration;
|
theAddress.mSelector = kAudioDevicePropertyStreamConfiguration;
|
||||||
|
|
Loading…
Reference in New Issue