diff options
author | Chris Robinson <[email protected]> | 2009-08-27 02:53:09 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-27 02:53:09 -0700 |
commit | 6bb14e45cee9d8d7da37675cc6933146f7a95155 (patch) | |
tree | 238b8354671a87e00867af28424a4bf23b813e1c /Alc/oss.c | |
parent | 45dc8048193162edbb886921cfcf2955c5232626 (diff) |
Store a copy of the device name in the device
Diffstat (limited to 'Alc/oss.c')
-rw-r--r-- | Alc/oss.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -147,6 +147,7 @@ static ALuint OSSCaptureProc(ALvoid *ptr) static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName) { + const char *devName = oss_device; char driver[64]; oss_data *data; @@ -156,10 +157,8 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName { if(strcmp(deviceName, oss_device)) return ALC_FALSE; - device->szDeviceName = oss_device; + devName = oss_device; } - else - device->szDeviceName = oss_device; data = (oss_data*)calloc(1, sizeof(oss_data)); data->killNow = 0; @@ -172,6 +171,7 @@ static ALCboolean oss_open_playback(ALCdevice *device, const ALCchar *deviceName return ALC_FALSE; } + device->szDeviceName = strdup(devName); device->ExtraData = data; return ALC_TRUE; } @@ -299,6 +299,7 @@ static void oss_stop_context(ALCdevice *device, ALCcontext *context) static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) { + const char *devName = oss_device_capture; int numFragmentsLogSize; int log2FragmentSize; unsigned int periods; @@ -318,10 +319,8 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) { if(strcmp(deviceName, oss_device_capture)) return ALC_FALSE; - device->szDeviceName = oss_device_capture; + devName = oss_device_capture; } - else - device->szDeviceName = oss_device_capture; data = (oss_data*)calloc(1, sizeof(oss_data)); data->killNow = 0; @@ -411,6 +410,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) return ALC_FALSE; } + device->szDeviceName = strdup(devName); return ALC_TRUE; } |