comparison src/audio/mint/SDL_mintaudio_dma8.c @ 2005:45af7d69f8eb

MiNT audio driver cleanups for clamping types and channels to supported values. int32 support now available in one instance.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 01 Sep 2006 06:32:54 +0000
parents c121d94672cb
children d48ead2d2ba5
comparison
equal deleted inserted replaced
2004:c27292a690b7 2005:45af7d69f8eb
216 Mint_CheckAudio(_THIS, SDL_AudioSpec * spec) 216 Mint_CheckAudio(_THIS, SDL_AudioSpec * spec)
217 { 217 {
218 int i, masterprediv, sfreq; 218 int i, masterprediv, sfreq;
219 unsigned long masterclock; 219 unsigned long masterclock;
220 220
221 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", spec->format & 0x00ff)); 221 DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
222 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000) != 0))); 222 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
223 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000) != 0))); 223 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
224 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
224 DEBUG_PRINT(("channels=%d, ", spec->channels)); 225 DEBUG_PRINT(("channels=%d, ", spec->channels));
225 DEBUG_PRINT(("freq=%d\n", spec->freq)); 226 DEBUG_PRINT(("freq=%d\n", spec->freq));
227
228 if (spec->channels > 2) {
229 spec->channels = 2; /* no more than stereo! */
230 }
226 231
227 /* Check formats available */ 232 /* Check formats available */
228 spec->format = AUDIO_S8; 233 spec->format = AUDIO_S8;
229 234
230 /* Calculate and select the closest frequency */ 235 /* Calculate and select the closest frequency */
267 #endif 272 #endif
268 273
269 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq); 274 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
270 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; 275 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
271 276
272 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", spec->format & 0x00ff)); 277 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format)));
273 DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000) != 0))); 278 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
274 DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000) != 0))); 279 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
280 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
275 DEBUG_PRINT(("channels=%d, ", spec->channels)); 281 DEBUG_PRINT(("channels=%d, ", spec->channels));
276 DEBUG_PRINT(("freq=%d\n", spec->freq)); 282 DEBUG_PRINT(("freq=%d\n", spec->freq));
277 283
278 return 0; 284 return 0;
279 } 285 }