aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/loopback.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-05 07:11:09 -0800
committerChris Robinson <[email protected]>2012-03-05 07:11:09 -0800
commitfe6e532c876bf3ec6776f76f9542038ac9c94d68 (patch)
tree31d29eb21462dbc02287030d8e3b6174dcab92cc /Alc/backends/loopback.c
parent5cdeeb47f3b4dedefd1ceb2b32c2f7754abc058d (diff)
Use a separate backend callback to start playback of the device
This allows us to properly update the ALCdevice and its resources with the new parameters before starting playback, instead of expecting the mixer to block and wait after it has begun. This also lets us avoid holding the device lock while resetting and starting the device, which helps prevent lock inversion on some backends (ie, one thread locking A then B, and another thread locking B then A), ultimately allowing certain backends to asynchronously update the ALCdevice without risk of lockup. Capture still has issues here, however.
Diffstat (limited to 'Alc/backends/loopback.c')
-rw-r--r--Alc/backends/loopback.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/backends/loopback.c b/Alc/backends/loopback.c
index 8a576361..3726974c 100644
--- a/Alc/backends/loopback.c
+++ b/Alc/backends/loopback.c
@@ -43,6 +43,12 @@ static ALCboolean loopback_reset_playback(ALCdevice *device)
return ALC_TRUE;
}
+static ALCboolean loopback_start_playback(ALCdevice *device)
+{
+ return ALC_TRUE;
+ (void)device;
+}
+
static void loopback_stop_playback(ALCdevice *device)
{
(void)device;
@@ -52,6 +58,7 @@ static const BackendFuncs loopback_funcs = {
loopback_open_playback,
loopback_close_playback,
loopback_reset_playback,
+ loopback_start_playback,
loopback_stop_playback,
NULL,
NULL,