[IMAADP32.ACM] Sync with Wine Staging 2.16. CORE-13762
authorAmine Khaldi <amine.khaldi@reactos.org>
Sun, 17 Sep 2017 22:54:07 +0000 (22:54 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 17 Sep 2017 22:54:07 +0000 (22:54 +0000)
0f0fb98 imaadp32.acm: Fix nibble ordering.
2a1c1a4 imaadp32.acm: Fix block size calculations.

svn path=/trunk/; revision=75879

reactos/dll/win32/imaadp32.acm/imaadp32.c
reactos/media/doc/README.WINE

index 8e4d7b3..f0f801a 100644 (file)
@@ -156,7 +156,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;
 }
 
@@ -447,7 +447,7 @@ static      void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi,
                                         &stepIndexL, &sampleL);
                 code2 = generate_nibble(R16(src + (4 * i + 2) * 2),
                                         &stepIndexL, &sampleL);
-                *dst++ = (code1 << 4) | code2;
+                *dst++ = (code2 << 4) | code1;
             }
             for (i = 0; i < 4; i++)
             {
@@ -455,7 +455,7 @@ static      void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi,
                                         &stepIndexR, &sampleR);
                 code2 = generate_nibble(R16(src + (4 * i + 3) * 2),
                                         &stepIndexR, &sampleR);
-                *dst++ = (code1 << 4) | code2;
+                *dst++ = (code2 << 4) | code1;
             }
             src += 32;
        }
@@ -511,7 +511,7 @@ static      void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi,
             src += 2;
             code2 = generate_nibble(R16(src), &stepIndex, &sample);
             src += 2;
-            *dst++ = (code1 << 4) | code2;
+            *dst++ = (code2 << 4) | code1;
        }
        dst = in_dst + adsi->pwfxDst->nBlockAlign;
     }
@@ -633,14 +633,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);
index a6ba88f..145acb4 100644 (file)
@@ -75,7 +75,7 @@ reactos/dll/win32/hnetcfg             # Synced to WineStaging-2.9
 reactos/dll/win32/httpapi             # Synced to WineStaging-2.9
 reactos/dll/win32/iccvid              # Synced to WineStaging-2.9
 reactos/dll/win32/ieframe             # Synced to WineStaging-2.9
-reactos/dll/win32/imaadp32.acm        # Synced to WineStaging-2.9
+reactos/dll/win32/imaadp32.acm        # Synced to WineStaging-2.16
 reactos/dll/win32/imagehlp            # Synced to WineStaging-2.9
 reactos/dll/win32/imm32               # Synced to Wine-1.7.27
 reactos/dll/win32/inetcomm            # Synced to WineStaging-2.9