Commit a39f5c21 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Merged r2906:2907 from 1.2 branch to trunk: power of two channels in dsp backend.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402230
parent 2a14d5cd
......@@ -166,6 +166,15 @@ DSP_OpenDevice(_THIS, const char *devname, int iscapture)
devname = ((iscapture) ? inputDevices[0] : outputDevices[0]);
}
/* Make sure fragment size stays a power of 2, or OSS fails. */
/* I don't know which of these are actually legal values, though... */
if (this->spec.channels > 8)
this->spec.channels = 8;
else if (this->spec.channels > 4)
this->spec.channels = 4;
else if (this->spec.channels > 2)
this->spec.channels = 2;
/* Initialize all variables that we clean on shutdown */
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
......
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