possible fix for a crash for some external audio interfaces
This commit is contained in:
parent
066d8abfaa
commit
423cec2ff2
1 changed files with 14 additions and 8 deletions
|
@ -243,6 +243,11 @@ void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID,
|
||||||
&iPropertySize,
|
&iPropertySize,
|
||||||
&sPropertyStringValue );
|
&sPropertyStringValue );
|
||||||
|
|
||||||
|
// first check if the string is not empty
|
||||||
|
strDeviceName = "UNKNOWN"; // init value in case no name is available
|
||||||
|
|
||||||
|
if ( CFStringGetLength ( sPropertyStringValue ) > 0 )
|
||||||
|
{
|
||||||
// convert CFString in c-string (quick hack!) and then in QString
|
// convert CFString in c-string (quick hack!) and then in QString
|
||||||
char* sC_strPropValue =
|
char* sC_strPropValue =
|
||||||
(char*) malloc ( CFStringGetLength ( sPropertyStringValue ) + 1 );
|
(char*) malloc ( CFStringGetLength ( sPropertyStringValue ) + 1 );
|
||||||
|
@ -253,6 +258,7 @@ void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID,
|
||||||
kCFStringEncodingISOLatin1 );
|
kCFStringEncodingISOLatin1 );
|
||||||
|
|
||||||
strDeviceName = sC_strPropValue;
|
strDeviceName = sC_strPropValue;
|
||||||
|
}
|
||||||
|
|
||||||
// check if device is input or output or both (is that possible?)
|
// check if device is input or output or both (is that possible?)
|
||||||
// we do this by trying to set the current device for the audio unit
|
// we do this by trying to set the current device for the audio unit
|
||||||
|
|
Loading…
Reference in a new issue