comparison src/audio/SDL_audio.c @ 3021:f3dcf04412cf

First shot at new audio resampling code.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 11 Jan 2009 04:46:42 +0000
parents 0b160c970b7e
children 77c3e67f0740
comparison
equal deleted inserted replaced
3020:70d876a0b90e 3021:f3dcf04412cf
369 silence = 0x80; 369 silence = 0x80;
370 } else { 370 } else {
371 silence = 0; 371 silence = 0;
372 } 372 }
373 373
374 #if 0 /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */
374 /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */ 375 /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */
375 if (device->convert.len_mult != 1 || device->convert.len_div != 1) { 376 if (device->convert.len_mult != 1 || device->convert.len_div != 1) {
376 /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */ 377 /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */
377 stream_max_len = 2 * device->spec.size; 378 stream_max_len = 2 * device->spec.size;
378 if (device->convert.len_mult > device->convert.len_div) { 379 if (device->convert.len_mult > device->convert.len_div) {
389 */ 390 */
390 istream_len = 391 istream_len =
391 device->spec.size * device->convert.len_div / 392 device->spec.size * device->convert.len_div /
392 device->convert.len_mult; 393 device->convert.len_mult;
393 } 394 }
395 #endif
394 396
395 /* stream_len = device->convert.len; */ 397 /* stream_len = device->convert.len; */
396 stream_len = device->spec.size; 398 stream_len = device->spec.size;
397 } else { 399 } else {
398 silence = device->spec.silence; 400 silence = device->spec.silence;