Skip to content

Commit ed766c7

Browse files
committed
Add constant for kCanBeDefaultDevice and kCanBeDefaultSystemDevice.
1 parent d7bb53e commit ed766c7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

BlackHole/BlackHole.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ struct ObjectInfo {
241241
#define kEnableVolumeControl true
242242
#endif
243243

244+
#ifndef kCanBeDefaultDevice
245+
#define kCanBeDefaultDevice true
246+
#endif
247+
248+
#ifndef kCanBeDefaultSystemDevice
249+
#define kCanBeDefaultSystemDevice true
250+
#endif
251+
244252
static pthread_mutex_t gPlugIn_StateMutex = PTHREAD_MUTEX_INITIALIZER;
245253
static UInt32 gPlugIn_RefCount = 0;
246254
static AudioServerPlugInHostRef gPlugIn_Host = NULL;
@@ -2627,7 +2635,7 @@ static OSStatus BlackHole_GetDevicePropertyData(AudioServerPlugInDriverRef inDri
26272635
// will use to play their content on and FaceTime will use as it's microhphone.
26282636
// Nearly all devices should allow for this.
26292637
FailWithAction(inDataSize < sizeof(UInt32), theAnswer = kAudioHardwareBadPropertySizeError, Done, "BlackHole_GetDevicePropertyData: not enough space for the return value of kAudioDevicePropertyDeviceCanBeDefaultDevice for the device");
2630-
*((UInt32*)outData) = 1;
2638+
*((UInt32*)outData) = kCanBeDefaultDevice;
26312639
*outDataSize = sizeof(UInt32);
26322640
break;
26332641

@@ -2637,7 +2645,7 @@ static OSStatus BlackHole_GetDevicePropertyData(AudioServerPlugInDriverRef inDri
26372645
// other incidental or UI-related sounds on. Most devices should allow this
26382646
// although devices with lots of latency may not want to.
26392647
FailWithAction(inDataSize < sizeof(UInt32), theAnswer = kAudioHardwareBadPropertySizeError, Done, "BlackHole_GetDevicePropertyData: not enough space for the return value of kAudioDevicePropertyDeviceCanBeDefaultSystemDevice for the device");
2640-
*((UInt32*)outData) = 1;
2648+
*((UInt32*)outData) = kCanBeDefaultSystemDevice;
26412649
*outDataSize = sizeof(UInt32);
26422650
break;
26432651

0 commit comments

Comments
 (0)