Commit 28cb5534 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winecoreaudio: 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 9281d015
......@@ -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;
}
......
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