output/osx: use nullptr instead of NULL
This commit is contained in:
parent
2a5feb225b
commit
11fb5bc3d0
@ -65,13 +65,13 @@ osx_output_configure(OSXOutput *oo, const config_param ¶m)
|
|||||||
{
|
{
|
||||||
const char *device = param.GetBlockValue("device");
|
const char *device = param.GetBlockValue("device");
|
||||||
|
|
||||||
if (device == NULL || 0 == strcmp(device, "default")) {
|
if (device == nullptr || 0 == strcmp(device, "default")) {
|
||||||
oo->component_subtype = kAudioUnitSubType_DefaultOutput;
|
oo->component_subtype = kAudioUnitSubType_DefaultOutput;
|
||||||
oo->device_name = NULL;
|
oo->device_name = nullptr;
|
||||||
}
|
}
|
||||||
else if (0 == strcmp(device, "system")) {
|
else if (0 == strcmp(device, "system")) {
|
||||||
oo->component_subtype = kAudioUnitSubType_SystemOutput;
|
oo->component_subtype = kAudioUnitSubType_SystemOutput;
|
||||||
oo->device_name = NULL;
|
oo->device_name = nullptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
oo->component_subtype = kAudioUnitSubType_HALOutput;
|
oo->component_subtype = kAudioUnitSubType_HALOutput;
|
||||||
@ -86,7 +86,7 @@ osx_output_init(const config_param ¶m, Error &error)
|
|||||||
OSXOutput *oo = new OSXOutput();
|
OSXOutput *oo = new OSXOutput();
|
||||||
if (!oo->base.Configure(param, error)) {
|
if (!oo->base.Configure(param, error)) {
|
||||||
delete oo;
|
delete oo;
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
osx_output_configure(oo, param);
|
osx_output_configure(oo, param);
|
||||||
@ -108,7 +108,7 @@ osx_output_set_device(OSXOutput *oo, Error &error)
|
|||||||
bool ret = true;
|
bool ret = true;
|
||||||
OSStatus status;
|
OSStatus status;
|
||||||
UInt32 size, numdevices;
|
UInt32 size, numdevices;
|
||||||
AudioDeviceID *deviceids = NULL;
|
AudioDeviceID *deviceids = nullptr;
|
||||||
char name[256];
|
char name[256];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ osx_output_set_device(OSXOutput *oo, Error &error)
|
|||||||
/* how many audio devices are there? */
|
/* how many audio devices are there? */
|
||||||
status = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices,
|
status = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices,
|
||||||
&size,
|
&size,
|
||||||
NULL);
|
nullptr);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
error.Format(osx_output_domain, status,
|
error.Format(osx_output_domain, status,
|
||||||
"Unable to determine number of OS X audio devices: %s",
|
"Unable to determine number of OS X audio devices: %s",
|
||||||
@ -206,7 +206,7 @@ osx_render(void *vdata,
|
|||||||
AudioBuffer *buffer = &buffer_list->mBuffers[0];
|
AudioBuffer *buffer = &buffer_list->mBuffers[0];
|
||||||
size_t buffer_size = buffer->mDataByteSize;
|
size_t buffer_size = buffer->mDataByteSize;
|
||||||
|
|
||||||
assert(od->buffer != NULL);
|
assert(od->buffer != nullptr);
|
||||||
|
|
||||||
od->mutex.lock();
|
od->mutex.lock();
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ osx_output_enable(AudioOutput *ao, Error &error)
|
|||||||
desc.componentFlags = 0;
|
desc.componentFlags = 0;
|
||||||
desc.componentFlagsMask = 0;
|
desc.componentFlagsMask = 0;
|
||||||
|
|
||||||
Component comp = FindNextComponent(NULL, &desc);
|
Component comp = FindNextComponent(nullptr, &desc);
|
||||||
if (comp == 0) {
|
if (comp == 0) {
|
||||||
error.Set(osx_output_domain,
|
error.Set(osx_output_domain,
|
||||||
"Error finding OS X component");
|
"Error finding OS X component");
|
||||||
|
Loading…
Reference in New Issue
Block a user