Zebediah Figura : imaadp32.acm: Fix block size calculations.

Alexandre Julliard julliard at winehq.org
Fri Jun 9 12:43:58 CDT 2017


Module: wine
Branch: master
Commit: 2a1c1a4bac6753b0aafc66bdcfa9821a8453c2e6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2a1c1a4bac6753b0aafc66bdcfa9821a8453c2e6

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Jun  8 10:15:20 2017 -0500

imaadp32.acm: Fix block size calculations.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/imaadp32.acm/imaadp32.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/dlls/imaadp32.acm/imaadp32.c b/dlls/imaadp32.acm/imaadp32.c
index 78a0ac4..7f4c5ea 100644
--- a/dlls/imaadp32.acm/imaadp32.c
+++ b/dlls/imaadp32.acm/imaadp32.c
@@ -154,7 +154,7 @@ static void     init_wfx_ima_adpcm(IMAADPCMWAVEFORMAT* awfx/*, DWORD nba*/)
     }
     pwfx->cbSize = sizeof(WORD);
 
-    awfx->wSamplesPerBlock = (pwfx->nBlockAlign - (4 * pwfx->nChannels) * 2) / pwfx->nChannels + 1;
+    awfx->wSamplesPerBlock = (pwfx->nBlockAlign - (4 * pwfx->nChannels)) * (2 / pwfx->nChannels) + 1;
     pwfx->nAvgBytesPerSec = (pwfx->nSamplesPerSec * pwfx->nBlockAlign) / awfx->wSamplesPerBlock;
 }
 
@@ -631,14 +631,7 @@ static	LRESULT	ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 	    afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;
-	    afd->pwfx->nBlockAlign = 1024;
-	    /* we got 4 bits per sample */
-	    afd->pwfx->nAvgBytesPerSec =
-		(afd->pwfx->nSamplesPerSec * 4) / 8;
-            if (afd->cbwfx >= sizeof(WAVEFORMATEX))
-                afd->pwfx->cbSize = sizeof(WORD);
-            if (afd->cbwfx >= sizeof(IMAADPCMWAVEFORMAT))
-                ((IMAADPCMWAVEFORMAT*)afd->pwfx)->wSamplesPerBlock = (1024 - 4 * afd->pwfx->nChannels) * (2 / afd->pwfx->nChannels) + 1;
+	    init_wfx_ima_adpcm((IMAADPCMWAVEFORMAT *)afd->pwfx);
 	    break;
 	default:
             WARN("Unsupported tag %08x\n", afd->dwFormatTag);




More information about the wine-cvs mailing list