diff options
author | Chris Robinson <[email protected]> | 2013-10-28 12:05:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-28 12:05:33 -0700 |
commit | f24cb447818ea21ff5a5d80d6396abb4723fd2ed (patch) | |
tree | 3f10c96f9e11d1f0dd58501f166ba399ebdbeda8 /Alc/backends | |
parent | 2912d130c26056f21e938bbd776bbe8583c055cd (diff) |
Move the device mutex to the backend
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/alsa.c | 1 | ||||
-rw-r--r-- | Alc/backends/base.h | 5 | ||||
-rw-r--r-- | Alc/backends/dsound.c | 1 | ||||
-rw-r--r-- | Alc/backends/mmdevapi.c | 1 | ||||
-rw-r--r-- | Alc/backends/null.c | 11 | ||||
-rw-r--r-- | Alc/backends/oss.c | 1 | ||||
-rw-r--r-- | Alc/backends/pulseaudio.c | 1 | ||||
-rw-r--r-- | Alc/backends/solaris.c | 1 | ||||
-rw-r--r-- | Alc/backends/wave.c | 1 |
9 files changed, 21 insertions, 2 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index c60187fa..0e0b4436 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -27,6 +27,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #include <alsa/asoundlib.h> diff --git a/Alc/backends/base.h b/Alc/backends/base.h index 272a3f65..22602b23 100644 --- a/Alc/backends/base.h +++ b/Alc/backends/base.h @@ -2,6 +2,7 @@ #define AL_BACKENDS_BASE_H #include "alMain.h" +#include "compat.h" struct ALCbackendVtable; @@ -10,8 +11,12 @@ typedef struct ALCbackend { const struct ALCbackendVtable *vtbl; ALCdevice *mDevice; + + CRITICAL_SECTION mMutex; } ALCbackend; +void ALCbackend_Construct(ALCbackend *self, ALCdevice *device); +void ALCbackend_Destruct(ALCbackend *self); ALint64 ALCbackend_getLatency(ALCbackend *self); void ALCbackend_lock(ALCbackend *self); void ALCbackend_unlock(ALCbackend *self); diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index f09967a0..9fa4bd61 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -35,6 +35,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #ifndef DSSPEAKER_5POINT1 # define DSSPEAKER_5POINT1 0x00000006 diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index fb70d609..31be2ed1 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -41,6 +41,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" DEFINE_GUID(KSDATAFORMAT_SUBTYPE_PCM, 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); diff --git a/Alc/backends/null.c b/Alc/backends/null.c index d21ebf0c..af68c585 100644 --- a/Alc/backends/null.c +++ b/Alc/backends/null.c @@ -28,6 +28,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #include "backends/base.h" @@ -85,8 +86,14 @@ static ALuint ALCnullBackend_mixerProc(ALvoid *ptr) } -static void ALCnullBackend_Destruct(ALCnullBackend* UNUSED(self)) +static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device) { + ALCbackend_Construct(STATIC_CAST(ALCbackend, self), device); +} + +static void ALCnullBackend_Destruct(ALCnullBackend *self) +{ + ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); } static ALCenum ALCnullBackend_open(ALCnullBackend *self, const ALCchar *name) @@ -197,7 +204,7 @@ ALCbackend* ALCnullBackendFactory_createBackend(ALCnullBackendFactory* UNUSED(se if(!backend) return NULL; SET_VTABLE2(ALCnullBackend, ALCbackend, backend); - STATIC_CAST(ALCbackend, backend)->mDevice = device; + ALCnullBackend_Construct(backend, device); return STATIC_CAST(ALCbackend, backend); } diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c index 35ae80cc..a9510a35 100644 --- a/Alc/backends/oss.c +++ b/Alc/backends/oss.c @@ -34,6 +34,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #include <sys/soundcard.h> diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 4dc016a1..c24b86e2 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -26,6 +26,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #include <pulse/pulseaudio.h> diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c index c6fd32e9..c4d40273 100644 --- a/Alc/backends/solaris.c +++ b/Alc/backends/solaris.c @@ -34,6 +34,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" #include <sys/audioio.h> diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c index e7698430..ec88862b 100644 --- a/Alc/backends/wave.c +++ b/Alc/backends/wave.c @@ -31,6 +31,7 @@ #include "alMain.h" #include "alu.h" #include "threads.h" +#include "compat.h" typedef struct { |