From fe6e532c876bf3ec6776f76f9542038ac9c94d68 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 5 Mar 2012 07:11:09 -0800 Subject: 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. --- OpenAL32/Include/alMain.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 2fbea8c3..20f6d656 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -449,6 +449,7 @@ typedef struct { ALCenum (*OpenPlayback)(ALCdevice*, const ALCchar*); void (*ClosePlayback)(ALCdevice*); ALCboolean (*ResetPlayback)(ALCdevice*); + ALCboolean (*StartPlayback)(ALCdevice*); void (*StopPlayback)(ALCdevice*); ALCenum (*OpenCapture)(ALCdevice*, const ALCchar*); @@ -630,6 +631,7 @@ struct ALCdevice_struct #define ALCdevice_OpenPlayback(a,b) ((a)->Funcs->OpenPlayback((a), (b))) #define ALCdevice_ClosePlayback(a) ((a)->Funcs->ClosePlayback((a))) #define ALCdevice_ResetPlayback(a) ((a)->Funcs->ResetPlayback((a))) +#define ALCdevice_StartPlayback(a) ((a)->Funcs->StartPlayback((a))) #define ALCdevice_StopPlayback(a) ((a)->Funcs->StopPlayback((a))) #define ALCdevice_OpenCapture(a,b) ((a)->Funcs->OpenCapture((a), (b))) #define ALCdevice_CloseCapture(a) ((a)->Funcs->CloseCapture((a))) -- cgit v1.2.3