Use a separate backend callback to start playback of the device
commitfe6e532c876bf3ec6776f76f9542038ac9c94d68
authorChris Robinson <chris.kcat@gmail.com>
Mon, 5 Mar 2012 15:11:09 +0000 (5 07:11 -0800)
committerChris Robinson <chris.kcat@gmail.com>
Mon, 5 Mar 2012 15:11:09 +0000 (5 07:11 -0800)
tree31d29eb21462dbc02287030d8e3b6174dcab92cc
parent5cdeeb47f3b4dedefd1ceb2b32c2f7754abc058d
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.
15 files changed:
Alc/ALc.c
Alc/backends/alsa.c
Alc/backends/dsound.c
Alc/backends/loopback.c
Alc/backends/mmdevapi.c
Alc/backends/null.c
Alc/backends/opensl.c
Alc/backends/oss.c
Alc/backends/portaudio.c
Alc/backends/pulseaudio.c
Alc/backends/sndio.c
Alc/backends/solaris.c
Alc/backends/wave.c
Alc/backends/winmm.c
OpenAL32/Include/alMain.h