comparison src/audio/amigaos/SDL_ahiaudio.c @ 2043:adf732f1f016

Formatting update
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Sep 2006 15:56:55 +0000
parents 02108bfd6550
children
comparison
equal deleted inserted replaced
2042:3908e1f808e1 2043:adf732f1f016
233 233
234 /* Determine the audio parameters from the AudioSpec */ 234 /* Determine the audio parameters from the AudioSpec */
235 while ((!valid_datatype) && (test_format)) { 235 while ((!valid_datatype) && (test_format)) {
236 valid_datatype = 1; 236 valid_datatype = 1;
237 switch (test_format) { 237 switch (test_format) {
238 case AUDIO_S8: 238 case AUDIO_S8:
239 D(bug("AUDIO_S8...\n")); 239 D(bug("AUDIO_S8...\n"));
240 spec->format = AUDIO_S8; 240 spec->format = AUDIO_S8;
241 this->hidden->bytespersample = 1; 241 this->hidden->bytespersample = 1;
242 if (spec->channels < 2) 242 if (spec->channels < 2)
243 this->hidden->type = AHIST_M8S; 243 this->hidden->type = AHIST_M8S;
244 else 244 else
245 this->hidden->type = AHIST_S8S; 245 this->hidden->type = AHIST_S8S;
246 break; 246 break;
247 247
248 case AUDIO_S16MSB: 248 case AUDIO_S16MSB:
249 D(bug("AUDIO_S16MSB...\n")); 249 D(bug("AUDIO_S16MSB...\n"));
250 spec->format = AUDIO_S16MSB; 250 spec->format = AUDIO_S16MSB;
251 this->hidden->bytespersample = 2; 251 this->hidden->bytespersample = 2;
252 if (spec->channels < 2) 252 if (spec->channels < 2)
253 this->hidden->type = AHIST_M16S; 253 this->hidden->type = AHIST_M16S;
254 else 254 else
255 this->hidden->type = AHIST_S16S; 255 this->hidden->type = AHIST_S16S;
256 break; 256 break;
257 257
258 case AUDIO_S32MSB: 258 case AUDIO_S32MSB:
259 D(bug("AUDIO_S32MSB...\n")); 259 D(bug("AUDIO_S32MSB...\n"));
260 spec->format = AUDIO_S32MSB; 260 spec->format = AUDIO_S32MSB;
261 this->hidden->bytespersample = 4; 261 this->hidden->bytespersample = 4;
262 if (spec->channels < 2) 262 if (spec->channels < 2)
263 this->hidden->type = AHIST_M32S; 263 this->hidden->type = AHIST_M32S;
264 else 264 else
265 this->hidden->type = AHIST_S32S; 265 this->hidden->type = AHIST_S32S;
266 break; 266 break;
267 267
268 default: 268 default:
269 valid_datatype = 0; 269 valid_datatype = 0;
270 test_format = SDL_NextAudioFormat(); 270 test_format = SDL_NextAudioFormat();
271 break; 271 break;
272 } 272 }
273 } 273 }
274 274
275 if (!valid_datatype) { /* shouldn't happen, but just in case... */ 275 if (!valid_datatype) { /* shouldn't happen, but just in case... */
276 SDL_SetError("Unsupported audio format"); 276 SDL_SetError("Unsupported audio format");
277 return (-1); 277 return (-1);
278 } 278 }
279 279
280 if (spec->channels > 2) { 280 if (spec->channels > 2) {
281 spec->channels = 2; /* will convert at higher level. */ 281 spec->channels = 2; /* will convert at higher level. */
282 } 282 }
283 283
284 D(bug("Before CalculateAudioSpec\n")); 284 D(bug("Before CalculateAudioSpec\n"));
285 /* Update the fragment size as size in bytes */ 285 /* Update the fragment size as size in bytes */
286 SDL_CalculateAudioSpec(spec); 286 SDL_CalculateAudioSpec(spec);