aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-13 18:05:10 -0800
committerChris Robinson <[email protected]>2018-11-13 18:41:24 -0800
commit7088f4e34a8557f2c73ee6635b3c7bf4ec958c63 (patch)
tree48fcff3de36d357a0cdbd97840a93e9bdd3be30e /Alc/backends
parent0dfb805fa2f85bed47612a75628d7d9742877b26 (diff)
Avoid calling through the vtable in the backends
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/dsound.cpp16
-rw-r--r--Alc/backends/qsa.cpp10
-rw-r--r--Alc/backends/sndio.cpp4
-rw-r--r--Alc/backends/wasapi.cpp20
-rw-r--r--Alc/backends/wave.cpp4
5 files changed, 27 insertions, 27 deletions
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp
index e760e9f5..10650175 100644
--- a/Alc/backends/dsound.cpp
+++ b/Alc/backends/dsound.cpp
@@ -257,9 +257,9 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self)
if(FAILED(err))
{
ERR("Failed to get buffer caps: 0x%lx\n", err);
- ALCdevice_Lock(device);
+ ALCdsoundPlayback_lock(self);
aluHandleDisconnect(device, "Failure retrieving playback buffer info: 0x%lx", err);
- ALCdevice_Unlock(device);
+ ALCdsoundPlayback_unlock(self);
return 1;
}
@@ -285,9 +285,9 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self)
if(FAILED(err))
{
ERR("Failed to play buffer: 0x%lx\n", err);
- ALCdevice_Lock(device);
+ ALCdsoundPlayback_lock(self);
aluHandleDisconnect(device, "Failure starting playback: 0x%lx", err);
- ALCdevice_Unlock(device);
+ ALCdsoundPlayback_unlock(self);
return 1;
}
Playing = true;
@@ -323,10 +323,10 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self)
if(SUCCEEDED(err))
{
// If we have an active context, mix data directly into output buffer otherwise fill with silence
- ALCdevice_Lock(device);
+ ALCdsoundPlayback_lock(self);
aluMixData(device, WritePtr1, WriteCnt1/FrameSize);
aluMixData(device, WritePtr2, WriteCnt2/FrameSize);
- ALCdevice_Unlock(device);
+ ALCdsoundPlayback_unlock(self);
// Unlock output buffer only when successfully locked
Buffer->Unlock(WritePtr1, WriteCnt1, WritePtr2, WriteCnt2);
@@ -334,9 +334,9 @@ FORCE_ALIGN static int ALCdsoundPlayback_mixerProc(ALCdsoundPlayback *self)
else
{
ERR("Buffer lock error: %#lx\n", err);
- ALCdevice_Lock(device);
+ ALCdsoundPlayback_lock(self);
aluHandleDisconnect(device, "Failed to lock output buffer: 0x%lx", err);
- ALCdevice_Unlock(device);
+ ALCdsoundPlayback_unlock(self);
return 1;
}
diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp
index 778e9e44..b2890705 100644
--- a/Alc/backends/qsa.cpp
+++ b/Alc/backends/qsa.cpp
@@ -188,7 +188,7 @@ DEFINE_ALCBACKEND_VTABLE(PlaybackWrapper);
FORCE_ALIGN static int qsa_proc_playback(void *ptr)
{
- PlaybackWrapper *self = ptr;
+ PlaybackWrapper *self = static_cast<PlaybackWrapper*>(ptr);
ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice;
qsa_data *data = self->ExtraData;
snd_pcm_channel_status_t status;
@@ -211,7 +211,7 @@ FORCE_ALIGN static int qsa_proc_playback(void *ptr)
device->FmtChans, device->FmtType, device->AmbiOrder
);
- V0(device->Backend,lock)();
+ PlaybackWrapper_lock(self);
while(!ATOMIC_LOAD(&data->killNow, almemory_order_acquire))
{
FD_ZERO(&wfds);
@@ -220,9 +220,9 @@ FORCE_ALIGN static int qsa_proc_playback(void *ptr)
timeout.tv_usec=0;
/* Select also works like time slice to OS */
- V0(device->Backend,unlock)();
+ PlaybackWrapper_unlock(self);
sret = select(data->audio_fd+1, NULL, &wfds, NULL, &timeout);
- V0(device->Backend,lock)();
+ PlaybackWrapper_lock(self);
if(sret == -1)
{
ERR("select error: %s\n", strerror(errno));
@@ -269,7 +269,7 @@ FORCE_ALIGN static int qsa_proc_playback(void *ptr)
}
}
}
- V0(device->Backend,unlock)();
+ PlaybackWrapper_unlock(self);
return 0;
}
diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp
index e35ce34e..818e107c 100644
--- a/Alc/backends/sndio.cpp
+++ b/Alc/backends/sndio.cpp
@@ -117,9 +117,9 @@ static int SndioPlayback_mixerProc(void *ptr)
if(wrote == 0)
{
ERR("sio_write failed\n");
- ALCdevice_Lock(device);
+ SndioPlayback_lock(self);
aluHandleDisconnect(device, "Failed to write playback samples");
- ALCdevice_Unlock(device);
+ SndioPlayback_unlock(self);
break;
}
diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp
index 50c0baa8..22edc09f 100644
--- a/Alc/backends/wasapi.cpp
+++ b/Alc/backends/wasapi.cpp
@@ -576,9 +576,9 @@ FORCE_ALIGN static int ALCwasapiPlayback_mixerProc(ALCwasapiPlayback *self)
if(FAILED(hr))
{
ERR("CoInitializeEx(nullptr, COINIT_MULTITHREADED) failed: 0x%08lx\n", hr);
- V0(device->Backend,lock)();
+ ALCwasapiPlayback_lock(self);
aluHandleDisconnect(device, "COM init failed: 0x%08lx", hr);
- V0(device->Backend,unlock)();
+ ALCwasapiPlayback_unlock(self);
return 1;
}
@@ -594,9 +594,9 @@ FORCE_ALIGN static int ALCwasapiPlayback_mixerProc(ALCwasapiPlayback *self)
if(FAILED(hr))
{
ERR("Failed to get padding: 0x%08lx\n", hr);
- V0(device->Backend,lock)();
+ ALCwasapiPlayback_lock(self);
aluHandleDisconnect(device, "Failed to retrieve buffer padding: 0x%08lx", hr);
- V0(device->Backend,unlock)();
+ ALCwasapiPlayback_unlock(self);
break;
}
self->mPadding.store(written, std::memory_order_relaxed);
@@ -625,9 +625,9 @@ FORCE_ALIGN static int ALCwasapiPlayback_mixerProc(ALCwasapiPlayback *self)
if(FAILED(hr))
{
ERR("Failed to buffer data: 0x%08lx\n", hr);
- V0(device->Backend,lock)();
+ ALCwasapiPlayback_lock(self);
aluHandleDisconnect(device, "Failed to send playback samples: 0x%08lx", hr);
- V0(device->Backend,unlock)();
+ ALCwasapiPlayback_unlock(self);
break;
}
}
@@ -1247,9 +1247,9 @@ FORCE_ALIGN int ALCwasapiCapture_recordProc(ALCwasapiCapture *self)
if(FAILED(hr))
{
ERR("CoInitializeEx(nullptr, COINIT_MULTITHREADED) failed: 0x%08lx\n", hr);
- V0(device->Backend,lock)();
+ ALCwasapiCapture_lock(self);
aluHandleDisconnect(device, "COM init failed: 0x%08lx", hr);
- V0(device->Backend,unlock)();
+ ALCwasapiCapture_unlock(self);
return 1;
}
@@ -1327,9 +1327,9 @@ FORCE_ALIGN int ALCwasapiCapture_recordProc(ALCwasapiCapture *self)
if(FAILED(hr))
{
- V0(device->Backend,lock)();
+ ALCwasapiCapture_lock(self);
aluHandleDisconnect(device, "Failed to capture samples: 0x%08lx", hr);
- V0(device->Backend,unlock)();
+ ALCwasapiCapture_unlock(self);
break;
}
diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp
index 2b10d286..ea57ba65 100644
--- a/Alc/backends/wave.cpp
+++ b/Alc/backends/wave.cpp
@@ -193,9 +193,9 @@ static int ALCwaveBackend_mixerProc(ALCwaveBackend *self)
if(ferror(self->mFile))
{
ERR("Error writing to file\n");
- ALCdevice_Lock(device);
+ ALCwaveBackend_lock(self);
aluHandleDisconnect(device, "Failed to write playback samples");
- ALCdevice_Unlock(device);
+ ALCwaveBackend_unlock(self);
break;
}
}