Commit 10d44c9a authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winealsa: Use the global lock to lock the session.

Mainly just for simplicity. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8e13b4bd
......@@ -77,8 +77,6 @@ typedef struct _AudioSession {
float *channel_vols;
BOOL mute;
CRITICAL_SECTION lock;
struct list entry;
} AudioSession;
......@@ -748,9 +746,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;
......@@ -3283,11 +3278,11 @@ static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume(
TRACE("ALSA does not support volume control\n");
EnterCriticalSection(&session->lock);
EnterCriticalSection(&g_sessions_lock);
session->master_vol = level;
LeaveCriticalSection(&session->lock);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
......@@ -3573,11 +3568,11 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume(
TRACE("ALSA does not support volume control\n");
EnterCriticalSection(&session->lock);
EnterCriticalSection(&g_sessions_lock);
session->channel_vols[index] = level;
LeaveCriticalSection(&session->lock);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
......@@ -3623,12 +3618,12 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes(
TRACE("ALSA does not support volume control\n");
EnterCriticalSection(&session->lock);
EnterCriticalSection(&g_sessions_lock);
for(i = 0; i < count; ++i)
session->channel_vols[i] = levels[i];
LeaveCriticalSection(&session->lock);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment