cpal icon indicating copy to clipboard operation
cpal copied to clipboard

Don't call AudioObjectGetPropertyData again if CFStringGetCStringPtr fails

Open micolous opened this issue 4 years ago • 1 comments

There's no indication that CFStringGetCStringPtr failing is destructive for the CFString:

https://developer.apple.com/documentation/corefoundation/1542133-cfstringgetcstringptr

So calling AudioObjectGetPropertyData a second time to get the device name isn't necessary.

It looks like this was an unintentional error in #399, but I don't have a wide-character install of macOS to try this against (to check that it doesn't regress #398).

cc @thavlik

micolous avatar Mar 18 '21 11:03 micolous

I tested this and seems to be right. Maybe it could get merged? It's a minor thing, but it would be nice!

nico-franco-gomez avatar Nov 15 '24 09:11 nico-franco-gomez

No part of this code (that I could find) is still present in /macos/mod.rs, and does not merge without conflicts. I strongly recommend closing this PR without merging.

wgibbs-rs avatar Jul 31 '25 21:07 wgibbs-rs

Thanks for the earlier PR. Like @wgibbs-rs stated, this code is no longer being used.

roderickvd avatar Oct 12 '25 20:10 roderickvd