aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-27 02:53:09 -0700
committerChris Robinson <[email protected]>2009-08-27 02:53:09 -0700
commit6bb14e45cee9d8d7da37675cc6933146f7a95155 (patch)
tree238b8354671a87e00867af28424a4bf23b813e1c /Alc/oss.c
parent45dc8048193162edbb886921cfcf2955c5232626 (diff)
Store a copy of the device name in the device
Diffstat (limited to 'Alc/oss.c')
-rw-r--r--Alc/oss.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/oss.c b/Alc/oss.c
index 5fe67c53..6b476ee4 100644
--- a/Alc/oss.c
+++ b/Alc/oss.c
@@ -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;
}