Skip to content
Snippets Groups Projects
Commit f95df54d authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard
Browse files

Allow 1% deviation from specified sampling rate for some soundcards.

parent 1f135c81
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,9 @@
DEFAULT_DEBUG_CHANNEL(wave)
/* Allow 1% deviation for sample rates (some ES137x cards) */
#define NEAR_MATCH(rate1,rate2) (((100*(rate1-rate2))/rate1)==0)
#ifdef HAVE_OSS
#define SOUND_DEV "/dev/dsp"
......@@ -632,7 +635,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
if (dsp_stereo != (WOutDev[wDevID].format.wf.nChannels > 1) ? 1 : 0)
ERR("Can't set stereo to %u (%d)\n",
(WOutDev[wDevID].format.wf.nChannels > 1) ? 1 : 0, dsp_stereo);
if (sample_rate != WOutDev[wDevID].format.wf.nSamplesPerSec)
if (!NEAR_MATCH(sample_rate,WOutDev[wDevID].format.wf.nSamplesPerSec))
ERR("Can't set sample_rate to %lu (%d)\n",
WOutDev[wDevID].format.wf.nSamplesPerSec, sample_rate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment