Huw Davies : winealsa: Remove an unnecessary check on the session channel count.

Alexandre Julliard julliard at winehq.org
Mon Feb 21 16:15:14 CST 2022


Module: wine
Branch: master
Commit: 8130371614b9845f23a935912493d501bbfb6574
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8130371614b9845f23a935912493d501bbfb6574

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Feb 18 08:29:28 2022 +0000

winealsa: Remove an unnecessary check on the session channel count.

This must always be at least equal to any given stream's channels.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winealsa.drv/mmdevdrv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index d1f9a1d35a4..8f198531cc0 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -1491,13 +1491,11 @@ static void adjust_buffer_volume(const ACImpl *This, BYTE *buf, snd_pcm_uframes_
 
     /* Adjust the buffer based on the volume for each channel */
     for (i = 0; i < channels; i++)
-        vol[i] = stream->vols[i] * This->session->master_vol;
-    for (i = 0; i < min(channels, This->session->channel_count); i++)
     {
+        vol[i] = stream->vols[i] * This->session->master_vol;
         vol[i] *= This->session->channel_vols[i];
         adjust |= vol[i] != 1.0f;
     }
-    while (i < channels) adjust |= vol[i++] != 1.0f;
     if (!adjust) return;
 
     /* Skip the frames we've already adjusted before */




More information about the wine-cvs mailing list