src/audio/SDL_audio.c
changeset 2053 716cf90f24a0
parent 2049 5f6550e5184f
child 2060 866052b01ee5
equal deleted inserted replaced
2052:eb5e61b72da3 2053:716cf90f24a0
   686                               device->spec.freq) < 0) {
   686                               device->spec.freq) < 0) {
   687             close_audio_device(device);
   687             close_audio_device(device);
   688             return 0;
   688             return 0;
   689         }
   689         }
   690         if (device->convert.needed) {
   690         if (device->convert.needed) {
   691             device->convert.len = desired.size;
   691             device->convert.len = (int) ( ((double) desired.size) /
       
   692                                           device->convert.len_ratio );
       
   693 
   692             device->convert.buf =
   694             device->convert.buf =
   693                 (Uint8 *) SDL_AllocAudioMem(device->convert.len *
   695                 (Uint8 *) SDL_AllocAudioMem(device->convert.len *
   694                                             device->convert.len_mult);
   696                                             device->convert.len_mult);
   695             if (device->convert.buf == NULL) {
   697             if (device->convert.buf == NULL) {
   696                 close_audio_device(device);
   698                 close_audio_device(device);