Huw Davies : winecoreaudio: Use the global lock to lock the session.
Module: wine Branch: master Commit: 28cb5534d1feb7134b4106d29174fd7e1a138b03 URL: https://source.winehq.org/git/wine.git/?a=commit;h=28cb5534d1feb7134b4106d29... Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Nov 17 09:09:53 2021 -0600 winecoreaudio: Use the global lock to lock the session. Mainly just for simplicity. Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winecoreaudio.drv/mmdevdrv.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 11be188d110..e82962db1ba 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -96,8 +96,6 @@ typedef struct _AudioSession { float *channel_vols; BOOL mute; - CRITICAL_SECTION lock; - struct list entry; } AudioSession; @@ -827,9 +825,6 @@ static AudioSession *create_session(const GUID *guid, IMMDevice *device, list_add_head(&g_sessions, &ret->entry); - InitializeCriticalSection(&ret->lock); - ret->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": AudioSession.lock"); - session_init_vols(ret, num_channels); ret->master_vol = 1.f; @@ -3056,13 +3051,13 @@ static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->master_vol = level; ret = ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; } @@ -3094,13 +3089,13 @@ static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->mute = mute; ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return S_OK; } @@ -3356,14 +3351,14 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); session->channel_vols[index] = level; WARN("CoreAudio doesn't support per-channel volume control\n"); ret = ca_session_setvol(session, index); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; } @@ -3408,14 +3403,14 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( if(context) FIXME("Notifications not supported yet\n"); - EnterCriticalSection(&session->lock); + EnterCriticalSection(&g_sessions_lock); for(i = 0; i < count; ++i) session->channel_vols[i] = levels[i]; ret = ca_session_setvol(session, -1); - LeaveCriticalSection(&session->lock); + LeaveCriticalSection(&g_sessions_lock); return ret; }
participants (1)
-
Alexandre Julliard