mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +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);
|
&cfName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool decoded = false;
|
||||||
char* cstr_name = 0;
|
char* cstr_name = 0;
|
||||||
if (error == kAudioHardwareNoError)
|
if (error == kAudioHardwareNoError)
|
||||||
{
|
{
|
||||||
CFIndex length = CFStringGetLength(cfName);
|
CFIndex length = CFStringGetLength(cfName);
|
||||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||||
cstr_name = new char[maxSize];
|
cstr_name = new char[maxSize];
|
||||||
CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
decoded = CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
chNameStream << (channel+1) << " - ";
|
chNameStream << (channel+1) << " - ";
|
||||||
|
|
||||||
if (cstr_name && (0 != std::strlen(cstr_name) ) ) {
|
if (cstr_name && decoded && (0 != std::strlen(cstr_name) ) ) {
|
||||||
chNameStream << cstr_name;
|
chNameStream << cstr_name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -533,18 +534,19 @@ WTErr WCMRCoreAudioDevice::UpdateDeviceOutputs()
|
||||||
&cfName);
|
&cfName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool decoded = false;
|
||||||
char* cstr_name = 0;
|
char* cstr_name = 0;
|
||||||
if (error == kAudioHardwareNoError )
|
if (error == kAudioHardwareNoError )
|
||||||
{
|
{
|
||||||
CFIndex length = CFStringGetLength(cfName);
|
CFIndex length = CFStringGetLength(cfName);
|
||||||
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||||
cstr_name = new char[maxSize];
|
cstr_name = new char[maxSize];
|
||||||
CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
decoded = CFStringGetCString(cfName, cstr_name, maxSize, kCFStringEncodingUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
chNameStream << (channel+1) << " - ";
|
chNameStream << (channel+1) << " - ";
|
||||||
|
|
||||||
if (cstr_name && (0 != std::strlen(cstr_name) ) ) {
|
if (cstr_name && decoded && (0 != std::strlen(cstr_name) ) ) {
|
||||||
chNameStream << cstr_name;
|
chNameStream << cstr_name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue