mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-10 08:50:10 +01:00
Sound (macOS): fix no sound devices detected error on old macOS version
This commit is contained in:
1 parent
cda4c62e9e
commit
130d5a5202
1 file changed
+14
-5
@@ -49,14 +49,23 @@ const char* ffDetectSound(FFlist* devices /* List of FFSoundDevice */)
|
||||
}, 0, NULL, &dataSize) == kAudioHardwareNoError && dataSize > 0)
|
||||
continue;
|
||||
|
||||
uint32_t connected;
|
||||
dataSize = sizeof(connected);
|
||||
uint32_t dataSource;
|
||||
dataSize = sizeof(dataSource);
|
||||
if(AudioObjectGetPropertyData(deviceId, &(AudioObjectPropertyAddress){
|
||||
kAudioDevicePropertyJackIsConnected,
|
||||
kAudioDevicePropertyDataSource,
|
||||
kAudioObjectPropertyScopeOutput,
|
||||
kAudioObjectPropertyElementMain
|
||||
}, 0, NULL, &dataSize, &connected) == kAudioHardwareNoError)
|
||||
if (!connected) continue;
|
||||
}, 0, NULL, &dataSize, &dataSource) == kAudioHardwareNoError && dataSource == 'hdpn')
|
||||
{
|
||||
uint32_t connected;
|
||||
dataSize = sizeof(connected);
|
||||
if(AudioObjectGetPropertyData(deviceId, &(AudioObjectPropertyAddress){
|
||||
kAudioDevicePropertyJackIsConnected,
|
||||
kAudioObjectPropertyScopeOutput,
|
||||
kAudioObjectPropertyElementMain
|
||||
}, 0, NULL, &dataSize, &connected) == kAudioHardwareNoError)
|
||||
if (!connected) continue;
|
||||
}
|
||||
|
||||
FFSoundDevice* device = (FFSoundDevice*) ffListAdd(devices);
|
||||
device->main = deviceId == mainDeviceId;
|
||||
|
||||
Reference in new issue
Block a user