[PATCH] msacm32: Reduce block align condition scope to test covered drivers

Bruno Jesus 00cpxxx at gmail.com
Tue Jan 17 10:48:02 CST 2017


MP3 files have different block sizes due to padding, this causes problems for apps that play mp3 audio (eg Morrowind / Oblivion). Instead of reversing the patch reduce the test scope to what we currently have tests for. After 2.0 I'll resume my work on finding wheather the test is correct there or should happen inside the driver.

Fixes a regression introduced by
http://source.winehq.org/git/wine.git/commitdiff/d4fd43c97117c9135f5b032e2cc8c899b4b91de5

And bug
https://bugs.winehq.org/show_bug.cgi?id=41290

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
---
 dlls/msacm32/stream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/msacm32/stream.c b/dlls/msacm32/stream.c
index 6e81151..e06503a 100644
--- a/dlls/msacm32/stream.c
+++ b/dlls/msacm32/stream.c
@@ -317,7 +317,9 @@ MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
         WARN("invalid use of reserved parameter\n");
         return MMSYSERR_INVALFLAG;
     }
-    if (pash->cbSrcLength < was->drvInst.pwfxSrc->nBlockAlign) {
+    if ((was->drvInst.pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM ||
+         was->drvInst.pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) &&
+        pash->cbSrcLength < was->drvInst.pwfxSrc->nBlockAlign) {
         WARN("source smaller than block align (%d < %d)\n",
              pash->cbSrcLength, was->drvInst.pwfxSrc->nBlockAlign);
         return pash->cbSrcLength ? ACMERR_NOTPOSSIBLE : MMSYSERR_INVALPARAM;
-- 
2.9.3




More information about the wine-patches mailing list