Commit df4409fb authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

winejack.drv only supports 16bit sound so we can simplify the sound

format checks.
parent 91c2507d
...@@ -1231,22 +1231,17 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) ...@@ -1231,22 +1231,17 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_ALLOCATED; return MMSYSERR_ALLOCATED;
} }
/* make sure we aren't being opened in 8 bit mode */ /* Only the PCM format is supported so far...
if(lpDesc->lpFormat->wBitsPerSample == 8) * Also we only support 16 bit mode.
{ */
TRACE("8bits per sample unsupported, returning WAVERR_BADFORMAT\n");
return WAVERR_BADFORMAT;
}
/* only PCM format is supported so far... */
if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM ||
lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nChannels == 0 ||
lpDesc->lpFormat->nSamplesPerSec == 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->wFormatTag, lpDesc->lpFormat->nChannels,
lpDesc->lpFormat->nSamplesPerSec); lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample);
return WAVERR_BADFORMAT; return WAVERR_BADFORMAT;
} }
...@@ -2104,22 +2099,17 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) ...@@ -2104,22 +2099,17 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_ALLOCATED; return MMSYSERR_ALLOCATED;
} }
/* make sure we aren't being opened in 8 bit mode */ /* Only the PCM format is supported so far...
if(lpDesc->lpFormat->wBitsPerSample == 8) * Also we only support 16 bit mode.
{ */
TRACE("8bits per sample unsupported, returning WAVERR_BADFORMAT\n");
return WAVERR_BADFORMAT;
}
/* only PCM format is supported so far... */
if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM ||
lpDesc->lpFormat->nChannels == 0 || lpDesc->lpFormat->nChannels == 0 ||
lpDesc->lpFormat->nSamplesPerSec == 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->wFormatTag, lpDesc->lpFormat->nChannels,
lpDesc->lpFormat->nSamplesPerSec); lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample);
return WAVERR_BADFORMAT; return WAVERR_BADFORMAT;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment