mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-13 01:56:34 +01:00
[Summary] Fixed issue with incorrect Mac OS string decoding on Maverics for device channel names
This commit is contained in:
parent
2a025411ef
commit
9c67a37f60
1 changed files with 6 additions and 4 deletions
|
|
@ -412,18 +412,19 @@ WTErr WCMRCoreAudioDevice::UpdateDeviceInputs()
|
|||
&cfName);
|
||||
}
|
||||
|
||||
bool decoded = false;
|
||||
char* cstr_name = 0;
|
||||
if (error == kAudioHardwareNoError)
|
||||
{
|
||||
CFIndex length = CFStringGetLength(cfName);
|
||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||
cstr_name = new char[maxSize];
|
||||
CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||
decoded = CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||
}
|
||||
|
||||
chNameStream << (channel+1) << " - ";
|
||||
|
||||
if (cstr_name && (0 != std::strlen(cstr_name) ) ) {
|
||||
if (cstr_name && decoded && (0 != std::strlen(cstr_name) ) ) {
|
||||
chNameStream << cstr_name;
|
||||
}
|
||||
else
|
||||
|
|
@ -533,18 +534,19 @@ WTErr WCMRCoreAudioDevice::UpdateDeviceOutputs()
|
|||
&cfName);
|
||||
}
|
||||
|
||||
bool decoded = false;
|
||||
char* cstr_name = 0;
|
||||
if (error == kAudioHardwareNoError )
|
||||
{
|
||||
CFIndex length = CFStringGetLength(cfName);
|
||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||
cstr_name = new char[maxSize];
|
||||
CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||
decoded = CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||
}
|
||||
|
||||
chNameStream << (channel+1) << " - ";
|
||||
|
||||
if (cstr_name && (0 != std::strlen(cstr_name) ) ) {
|
||||
if (cstr_name && decoded && (0 != std::strlen(cstr_name) ) ) {
|
||||
chNameStream << cstr_name;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue