winealsa: Store the session channel vols in the stream.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2022-02-18 08:29:29 +00:00 committed by Alexandre Julliard
parent 8130371614
commit a4de96a1f0
1 changed files with 9 additions and 2 deletions

View File

@ -327,7 +327,7 @@ static void set_stream_volumes(ACImpl *This)
unsigned int i;
for(i = 0; i < stream->fmt->nChannels; i++)
stream->vols[i] = This->vols[i];
stream->vols[i] = This->vols[i] * This->session->channel_vols[i];
}
HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids_out, GUID **guids_out,
@ -1493,7 +1493,6 @@ static void adjust_buffer_volume(const ACImpl *This, BYTE *buf, snd_pcm_uframes_
for (i = 0; i < channels; i++)
{
vol[i] = stream->vols[i] * This->session->master_vol;
vol[i] *= This->session->channel_vols[i];
adjust |= vol[i] != 1.0f;
}
if (!adjust) return;
@ -3375,6 +3374,7 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume(
{
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
ACImpl *client;
TRACE("(%p)->(%d, %f, %s)\n", session, index, level,
wine_dbgstr_guid(context));
@ -3394,6 +3394,9 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume(
session->channel_vols[index] = level;
LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry)
set_stream_volumes(client);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;
@ -3425,6 +3428,7 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes(
AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface);
AudioSession *session = This->session;
unsigned int i;
ACImpl *client;
TRACE("(%p)->(%d, %p, %s)\n", session, count, levels,
wine_dbgstr_guid(context));
@ -3445,6 +3449,9 @@ static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes(
for(i = 0; i < count; ++i)
session->channel_vols[i] = levels[i];
LIST_FOR_EACH_ENTRY(client, &session->clients, ACImpl, entry)
set_stream_volumes(client);
LeaveCriticalSection(&g_sessions_lock);
return S_OK;