aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-03-28 22:11:34 -0700
committerChris Robinson <[email protected]>2014-03-28 22:11:34 -0700
commit7b93e10f7a24b7e18c916b0f791d9998f9b4b800 (patch)
tree204d07479d2f25e4170edfc80c68c810826384b2 /Alc/ALc.c
parent7570195b0973770e2b19551399fcf0e4d3b81a21 (diff)
Use an al_string for the device name
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 93e773c3..b6cc3114 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2024,8 +2024,7 @@ static ALCvoid FreeDevice(ALCdevice *device)
free(device->Bs2b);
device->Bs2b = NULL;
- free(device->DeviceName);
- device->DeviceName = NULL;
+ AL_STRING_DEINIT(device->DeviceName);
al_free(device);
}
@@ -2355,7 +2354,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *Device, ALCenum para
case ALC_ALL_DEVICES_SPECIFIER:
if(VerifyDevice(Device))
{
- value = Device->DeviceName;
+ value = al_string_get_cstr(Device->DeviceName);
ALCdevice_DecRef(Device);
}
else
@@ -2368,7 +2367,7 @@ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *Device, ALCenum para
case ALC_CAPTURE_DEVICE_SPECIFIER:
if(VerifyDevice(Device))
{
- value = Device->DeviceName;
+ value = al_string_get_cstr(Device->DeviceName);
ALCdevice_DecRef(Device);
}
else
@@ -3069,7 +3068,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Flags = 0;
device->Bs2b = NULL;
device->Bs2bLevel = 0;
- device->DeviceName = NULL;
+ AL_STRING_INIT(device->DeviceName);
device->ContextList = NULL;
@@ -3285,7 +3284,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->next = DeviceList;
} while(CompExchangePtr((XchgPtr*)&DeviceList, device->next, device) != device->next);
- TRACE("Created device %p, \"%s\"\n", device, device->DeviceName);
+ TRACE("Created device %p, \"%s\"\n", device, al_string_get_cstr(device->DeviceName));
return device;
}
@@ -3365,6 +3364,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
device->Connected = ALC_TRUE;
device->Type = Capture;
+ AL_STRING_INIT(device->DeviceName);
+
InitUIntMap(&device->BufferMap, ~0);
InitUIntMap(&device->EffectMap, ~0);
InitUIntMap(&device->FilterMap, ~0);
@@ -3372,8 +3373,6 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
InitUIntMap(&device->PresetMap, ~0);
InitUIntMap(&device->FontsoundMap, ~0);
- device->DeviceName = NULL;
-
if(!CaptureBackend.getFactory)
device->Backend = create_backend_wrapper(device, &CaptureBackend.Funcs,
ALCbackend_Capture);
@@ -3414,7 +3413,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
device->next = DeviceList;
} while(CompExchangePtr((XchgPtr*)&DeviceList, device->next, device) != device->next);
- TRACE("Created device %p, \"%s\"\n", device, device->DeviceName);
+ TRACE("Created device %p, \"%s\"\n", device, al_string_get_cstr(device->DeviceName));
return device;
}
@@ -3535,7 +3534,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
device->Flags = 0;
device->Bs2b = NULL;
device->Bs2bLevel = 0;
- device->DeviceName = NULL;
+ AL_STRING_INIT(device->DeviceName);
device->ContextList = NULL;