diff options
author | Chris Robinson <[email protected]> | 2007-12-14 08:51:45 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-12-14 08:51:45 -0800 |
commit | 5f4659534abfc3a27cdae32606f699f189275ec8 (patch) | |
tree | 93a9e9978b28d1548b880c7169fb53ba161f0a31 /Alc/alsa.c | |
parent | 5da394ab617ab7d11e5b11610bb8dd83033e3920 (diff) |
Store a persistant name string with the device struct
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r-- | Alc/alsa.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -280,6 +280,7 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam if(allDevNameMap[idx].name && strcmp(deviceName, allDevNameMap[idx].name) == 0) { + device->szDeviceName = allDevNameMap[idx].name; if(idx > 0) sprintf(driver, "hw:%d,%d", allDevNameMap[idx].card, allDevNameMap[idx].dev); goto open_alsa; @@ -290,6 +291,7 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam if(alsaDeviceList[idx] && strcmp(deviceName, alsaDeviceList[idx]) == 0) { + device->szDeviceName = alsaDeviceList[idx]; if(idx > 0) sprintf(driver, "hw:%zd,0", idx-1); goto open_alsa; @@ -297,11 +299,8 @@ static ALCboolean alsa_open_playback(ALCdevice *device, const ALCchar *deviceNam } return ALC_FALSE; } - - if(deviceName) - strcpy(device->szDeviceName, deviceName); else - strcpy(device->szDeviceName, alsaDeviceList[0]); + device->szDeviceName = alsaDeviceList[0]; open_alsa: data = (alsa_data*)calloc(1, sizeof(alsa_data)); @@ -444,6 +443,7 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam if(alsaCaptureDeviceList[idx] && strcmp(deviceName, alsaCaptureDeviceList[idx]) == 0) { + pDevice->szDeviceName = alsaCaptureDeviceList[idx]; if(idx > 0) sprintf(driver, "hw:%zd,0", idx-1); goto open_alsa; @@ -451,11 +451,8 @@ static ALCboolean alsa_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam } return ALC_FALSE; } - - if(deviceName) - strcpy(pDevice->szDeviceName, deviceName); else - strcpy(pDevice->szDeviceName, alsaCaptureDeviceList[0]); + pDevice->szDeviceName = alsaCaptureDeviceList[0]; open_alsa: data = (alsa_data*)calloc(1, sizeof(alsa_data)); |