Commit 6bde1341 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Block fruity channel values in dspaudio, or the fragment size won't be a

 power of 2.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402229
parent 72c5d1e8
......@@ -168,6 +168,15 @@ static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
int frag_spec;
Uint16 test_format;
/* 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 (spec->channels > 8)
spec->channels = 8;
else if (spec->channels > 4)
spec->channels = 4;
else if (spec->channels > 2)
spec->channels = 2;
/* Open the audio device */
audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
if ( audio_fd < 0 ) {
......
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