Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/winealsa.drv/mmdevdrv.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 8f198531cc0..222decdb150 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -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;
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Fri, Feb 18, 2022 at 08:29:29AM +0000, Huw Davies wrote:
Signed-off-by: Huw Davies huw@codeweavers.com
dlls/winealsa.drv/mmdevdrv.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 8f198531cc0..222decdb150 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -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;
} if (!adjust) return;vol[i] *= This->session->channel_vols[i]; adjust |= vol[i] != 1.0f;
@@ -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;
-- 2.25.1