Mercurial > sdl-ios-xcode
comparison src/audio/dsp/SDL_dspaudio.c @ 2071:579abbb51f80
Merged r2906:2907 from 1.2 branch to trunk: power of two channels in dsp backend.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 13 Nov 2006 00:38:13 +0000 |
parents | 866052b01ee5 |
children | 99210400e8b9 |
comparison
equal
deleted
inserted
replaced
2070:dbfa1ebd73b0 | 2071:579abbb51f80 |
---|---|
164 return 0; | 164 return 0; |
165 } | 165 } |
166 devname = ((iscapture) ? inputDevices[0] : outputDevices[0]); | 166 devname = ((iscapture) ? inputDevices[0] : outputDevices[0]); |
167 } | 167 } |
168 | 168 |
169 /* Make sure fragment size stays a power of 2, or OSS fails. */ | |
170 /* I don't know which of these are actually legal values, though... */ | |
171 if (this->spec.channels > 8) | |
172 this->spec.channels = 8; | |
173 else if (this->spec.channels > 4) | |
174 this->spec.channels = 4; | |
175 else if (this->spec.channels > 2) | |
176 this->spec.channels = 2; | |
177 | |
169 /* Initialize all variables that we clean on shutdown */ | 178 /* Initialize all variables that we clean on shutdown */ |
170 this->hidden = (struct SDL_PrivateAudioData *) | 179 this->hidden = (struct SDL_PrivateAudioData *) |
171 SDL_malloc((sizeof *this->hidden)); | 180 SDL_malloc((sizeof *this->hidden)); |
172 if (this->hidden == NULL) { | 181 if (this->hidden == NULL) { |
173 SDL_OutOfMemory(); | 182 SDL_OutOfMemory(); |