summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-11-04 10:52:03 -0800
committerChris Robinson <[email protected]>2013-11-04 10:52:03 -0800
commit692ab1085dd75c0ac696f3effe61bc9223181547 (patch)
treee40d6ed46e7ee47c3cc7fc56e30f62a24406c1dd /Alc
parent94aeb5f52e656e021ce626ef523fb4a29cce117f (diff)
Only set device functions when needed
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 95b262b6..0d1236d1 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -2850,7 +2850,6 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
}
//Validate device
- device->Funcs = &PlaybackBackend.Funcs;
device->ref = 1;
device->Connected = ALC_TRUE;
device->Type = Playback;
@@ -2879,7 +2878,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
device->UpdateSize = 1024;
if(!PlaybackBackend.getFactory)
+ {
+ device->Funcs = &PlaybackBackend.Funcs;
device->Backend = create_backend_wrapper(device, ALCbackend_Playback);
+ }
else
{
ALCbackendFactory *factory = PlaybackBackend.getFactory();
@@ -3134,7 +3136,6 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
}
//Validate device
- device->Funcs = &CaptureBackend.Funcs;
device->ref = 1;
device->Connected = ALC_TRUE;
device->Type = Capture;
@@ -3146,7 +3147,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
device->DeviceName = NULL;
if(!CaptureBackend.getFactory)
+ {
+ device->Funcs = &CaptureBackend.Funcs;
device->Backend = create_backend_wrapper(device, ALCbackend_Capture);
+ }
else
{
ALCbackendFactory *factory = CaptureBackend.getFactory();