dsound: trivial simplifications

Alexander E. Patrakov patrakov at gmail.com
Sat May 19 08:36:40 CDT 2012


Just two cases where the needed value can be obtained by less code.

-- 
Alexander E. Patrakov
-------------- next part --------------
From 30260c5683317c111afa3ee86bebde40fd31c257 Mon Sep 17 00:00:00 2001
From: "Alexander E. Patrakov" <patrakov at gmail.com>
Date: Sat, 19 May 2012 17:29:55 +0600
Subject: [PATCH 2/3] dsound: trivial simplifications

---
 dlls/dsound/mixer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
index fed9165..09b69b4 100644
--- a/dlls/dsound/mixer.c
+++ b/dlls/dsound/mixer.c
@@ -257,7 +257,7 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, float *f
     float freqAcc_end = freqAcc_start + count * freqAdjust;
     UINT dsbfirstep = dsb->firstep;
     UINT channels = dsb->mix_channels;
-    UINT max_ipos = freqAcc_start + count * freqAdjust;
+    UINT max_ipos = freqAcc_end;
 
     UINT fir_cachesize = (fir_len + dsbfirstep - 2) / dsbfirstep;
     UINT required_input = max_ipos + fir_cachesize;
@@ -289,7 +289,7 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, float *f
         int fir_used = 0;
         while (idx < fir_len - 1) {
             fir_copy[fir_used++] = fir[idx] * (1.0 - rem) + fir[idx + 1] * rem;
-            idx += dsb->firstep;
+            idx += dsbfirstep;
         }
 
         assert(fir_used <= fir_cachesize);
-- 
1.7.8.6


More information about the wine-patches mailing list