[Core Audio Output] Fix possible bug in enumerator
Fix a potential bug where the device enumerator would return a nil device name string, which would result in a crash. Instead, report an unknown numbered device. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
7cf6a7e03b
commit
5a6295be1e
|
@ -546,7 +546,9 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
|
|||
}
|
||||
|
||||
BOOL stop = NO;
|
||||
block([NSString stringWithString:(__bridge NSString *)name],
|
||||
NSString *deviceName = name ? [NSString stringWithString:(__bridge NSString *)name] : [NSString stringWithFormat:@"Unknown device %u", (unsigned int)devids[i]];
|
||||
|
||||
block(deviceName,
|
||||
devids[i],
|
||||
systemDefault,
|
||||
&stop);
|
||||
|
|
Loading…
Reference in New Issue