[PATCH 07/12] msg711.acm: Remove unnecessary checks.

Zebediah Figura z.figura12 at gmail.com
Tue Jun 6 15:14:56 CDT 2017


These are already checked in msacm32 or not checked on Windows.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/msg711.acm/msg711.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/dlls/msg711.acm/msg711.c b/dlls/msg711.acm/msg711.c
index dc1661c7db..ad296af0be 100644
--- a/dlls/msg711.acm/msg711.c
+++ b/dlls/msg711.acm/msg711.c
@@ -751,7 +751,6 @@ static	LRESULT	G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 	switch (afd->dwFormatTag)
         {
 	case WAVE_FORMAT_PCM:
-	    if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE;
 	    afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
@@ -759,7 +758,6 @@ static	LRESULT	G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 	    afd->pwfx->nAvgBytesPerSec = afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
 	    break;
 	case WAVE_FORMAT_ALAW:
-	    if (afd->dwFormatIndex >= NUM_ALAW_FORMATS) return ACMERR_NOTPOSSIBLE;
 	    afd->pwfx->nChannels = ALaw_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = ALaw_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = ALaw_Formats[afd->dwFormatIndex].nBits;
@@ -768,7 +766,6 @@ static	LRESULT	G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
             afd->pwfx->cbSize = 0;
 	    break;
 	case WAVE_FORMAT_MULAW:
-	    if (afd->dwFormatIndex >= NUM_ULAW_FORMATS) return ACMERR_NOTPOSSIBLE;
 	    afd->pwfx->nChannels = ULaw_Formats[afd->dwFormatIndex].nChannels;
 	    afd->pwfx->nSamplesPerSec = ULaw_Formats[afd->dwFormatIndex].rate;
 	    afd->pwfx->wBitsPerSample = ULaw_Formats[afd->dwFormatIndex].nBits;
@@ -798,10 +795,8 @@ static	LRESULT	G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
 static	LRESULT	G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
 {
     /* some tests ... */
-    if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
-	adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
+    if (adfs->pwfxSrc->wFormatTag == adfs->pwfxDst->wFormatTag ||
 	G711_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
-    /* FIXME: should do those tests against the real size (according to format tag */
 
     /* If no suggestion for destination, then copy source value */
     if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
-- 
2.13.0




More information about the wine-patches mailing list