From df4409fb954fbaadd53c6ddd18dfefd8e3ce3bc3 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Wed, 5 May 2004 01:06:27 +0000 Subject: [PATCH] winejack.drv only supports 16bit sound so we can simplify the sound format checks. --- dlls/winmm/winejack/audio.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/dlls/winmm/winejack/audio.c b/dlls/winmm/winejack/audio.c index 43275d52c9..a75fd38d5e 100644 --- a/dlls/winmm/winejack/audio.c +++ b/dlls/winmm/winejack/audio.c @@ -1231,22 +1231,17 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_ALLOCATED; } - /* make sure we aren't being opened in 8 bit mode */ - if(lpDesc->lpFormat->wBitsPerSample == 8) - { - TRACE("8bits per sample unsupported, returning WAVERR_BADFORMAT\n"); - return WAVERR_BADFORMAT; - } - - /* only PCM format is supported so far... */ + /* Only the PCM format is supported so far... + * Also we only support 16 bit mode. + */ if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nSamplesPerSec == 0 || - (lpDesc->lpFormat->wBitsPerSample!=8 && lpDesc->lpFormat->wBitsPerSample!=16)) + lpDesc->lpFormat->wBitsPerSample != 16) { - WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld wBitsPerSample=%d !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, - lpDesc->lpFormat->nSamplesPerSec); + lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample); return WAVERR_BADFORMAT; } @@ -2104,22 +2099,17 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) return MMSYSERR_ALLOCATED; } - /* make sure we aren't being opened in 8 bit mode */ - if(lpDesc->lpFormat->wBitsPerSample == 8) - { - TRACE("8bits per sample unsupported, returning WAVERR_BADFORMAT\n"); - return WAVERR_BADFORMAT; - } - - /* only PCM format is supported so far... */ + /* Only the PCM format is supported so far... + * Also we only support 16 bit mode. + */ if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nSamplesPerSec == 0 || - (lpDesc->lpFormat->wBitsPerSample!=8 && lpDesc->lpFormat->wBitsPerSample!=16)) + lpDesc->lpFormat->wBitsPerSample!=16) { - WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld !\n", + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%ld wBitsPerSample=%d !\n", lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, - lpDesc->lpFormat->nSamplesPerSec); + lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample); return WAVERR_BADFORMAT; } -- 2.32.0.93.g670b81a890