[IMAADP32.ACM] Sync with Wine Staging 3.17. CORE-15127

This commit is contained in:
Amine Khaldi 2018-10-01 12:52:44 +01:00
parent 336b2a4564
commit d4bc0feb6e
2 changed files with 7 additions and 10 deletions

View file

@ -79,9 +79,6 @@ static const Format ADPCM_Formats[] =
{1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100}, {1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100},
}; };
#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0]))
#define NUM_ADPCM_FORMATS (sizeof(ADPCM_Formats) / sizeof(ADPCM_Formats[0]))
/*********************************************************************** /***********************************************************************
* ADPCM_GetFormatIndex * ADPCM_GetFormatIndex
*/ */
@ -93,11 +90,11 @@ static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx)
switch (wfx->wFormatTag) switch (wfx->wFormatTag)
{ {
case WAVE_FORMAT_PCM: case WAVE_FORMAT_PCM:
hi = NUM_PCM_FORMATS; hi = ARRAY_SIZE(PCM_Formats);
fmts = PCM_Formats; fmts = PCM_Formats;
break; break;
case WAVE_FORMAT_IMA_ADPCM: case WAVE_FORMAT_IMA_ADPCM:
hi = NUM_ADPCM_FORMATS; hi = ARRAY_SIZE(ADPCM_Formats);
fmts = ADPCM_Formats; fmts = ADPCM_Formats;
break; break;
default: default:
@ -585,13 +582,13 @@ static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
case 0: case 0:
aftd->dwFormatTag = WAVE_FORMAT_PCM; aftd->dwFormatTag = WAVE_FORMAT_PCM;
aftd->cbFormatSize = sizeof(PCMWAVEFORMAT); aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
aftd->cStandardFormats = NUM_PCM_FORMATS; aftd->cStandardFormats = ARRAY_SIZE(PCM_Formats);
lstrcpyW(aftd->szFormatTag, szPcm); lstrcpyW(aftd->szFormatTag, szPcm);
break; break;
case 1: case 1:
aftd->dwFormatTag = WAVE_FORMAT_IMA_ADPCM; aftd->dwFormatTag = WAVE_FORMAT_IMA_ADPCM;
aftd->cbFormatSize = sizeof(IMAADPCMWAVEFORMAT); aftd->cbFormatSize = sizeof(IMAADPCMWAVEFORMAT);
aftd->cStandardFormats = NUM_ADPCM_FORMATS; aftd->cStandardFormats = ARRAY_SIZE(ADPCM_Formats);
lstrcpyW(aftd->szFormatTag, szImaAdPcm); lstrcpyW(aftd->szFormatTag, szImaAdPcm);
break; break;
} }
@ -614,7 +611,7 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
switch (afd->dwFormatTag) switch (afd->dwFormatTag)
{ {
case WAVE_FORMAT_PCM: case WAVE_FORMAT_PCM:
if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE; if (afd->dwFormatIndex >= ARRAY_SIZE(PCM_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels; afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits; afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
@ -627,7 +624,7 @@ static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign; afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
break; break;
case WAVE_FORMAT_IMA_ADPCM: case WAVE_FORMAT_IMA_ADPCM:
if (afd->dwFormatIndex >= NUM_ADPCM_FORMATS) return ACMERR_NOTPOSSIBLE; if (afd->dwFormatIndex >= ARRAY_SIZE(ADPCM_Formats)) return ACMERR_NOTPOSSIBLE;
afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels; afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels;
afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate; afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate;
afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits; afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;

View file

@ -75,7 +75,7 @@ reactos/dll/win32/hnetcfg # Synced to WineStaging-3.9
reactos/dll/win32/httpapi # Synced to WineStaging-3.3 reactos/dll/win32/httpapi # Synced to WineStaging-3.3
reactos/dll/win32/iccvid # Synced to WineStaging-3.3 reactos/dll/win32/iccvid # Synced to WineStaging-3.3
reactos/dll/win32/ieframe # Synced to WineStaging-3.17 reactos/dll/win32/ieframe # Synced to WineStaging-3.17
reactos/dll/win32/imaadp32.acm # Synced to WineStaging-3.3 reactos/dll/win32/imaadp32.acm # Synced to WineStaging-3.17
reactos/dll/win32/imagehlp # Synced to WineStaging-3.3 reactos/dll/win32/imagehlp # Synced to WineStaging-3.3
reactos/dll/win32/imm32 # Synced to WineStaging-3.9 reactos/dll/win32/imm32 # Synced to WineStaging-3.9
reactos/dll/win32/inetcomm # Synced to WineStaging-3.3 reactos/dll/win32/inetcomm # Synced to WineStaging-3.3