From 6b272ff585ee5e4563348e115d3c2b5fe689d2e7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 15 Feb 2012 20:52:49 -0800 Subject: Add a device parameter to alcLoopbackOpenDeviceSOFT --- Alc/ALc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index e807c408..b399b692 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -2658,12 +2658,18 @@ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *pDevice) * * Open a loopback device, for manual rendering. */ -ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(void) +ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(ALCdevice *device) { - ALCdevice *device; - DO_INITCONFIG(); + /* Make sure the device, if specified, belongs to us. */ + if(device && !(device=VerifyDevice(device))) + { + alcSetError(device, ALC_INVALID_DEVICE); + return NULL; + } + if(device) ALCdevice_DecRef(device); + device = calloc(1, sizeof(ALCdevice)); if(!device) { -- cgit v1.2.3