Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merged r2906:2907 from 1.2 branch to trunk: power of two channels in …
…dsp backend.
  • Loading branch information
icculus committed Nov 13, 2006
1 parent 4ab5379 commit 4e983b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/audio/dsp/SDL_dspaudio.c
Expand Up @@ -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));
Expand Down

0 comments on commit 4e983b0

Please sign in to comment.