From 6bb14e45cee9d8d7da37675cc6933146f7a95155 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 27 Aug 2009 02:53:09 -0700 Subject: Store a copy of the device name in the device --- Alc/wave.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Alc/wave.c') diff --git a/Alc/wave.c b/Alc/wave.c index 578b769e..47f43b66 100644 --- a/Alc/wave.c +++ b/Alc/wave.c @@ -108,6 +108,7 @@ static ALuint WaveProc(ALvoid *ptr) static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceName) { + const char *devName = waveDevice; wave_data *data; const char *fname; @@ -119,10 +120,8 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam { if(strcmp(deviceName, waveDevice) != 0) return ALC_FALSE; - device->szDeviceName = waveDevice; + devName = waveDevice; } - else - device->szDeviceName = waveDevice; data = (wave_data*)calloc(1, sizeof(wave_data)); @@ -134,6 +133,7 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam return ALC_FALSE; } + device->szDeviceName = strdup(devName); device->ExtraData = data; return ALC_TRUE; } -- cgit v1.2.3