mirror of https://github.com/encounter/SDL.git
Fixed bus error when converting 16-bit to float for non-integral-multiple sample rates
This commit is contained in:
parent
366c77a9f0
commit
b2f6c4c1bd
|
@ -1191,8 +1191,10 @@ open_audio_device(const char *devname, int iscapture,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (device->convert.needed) {
|
if (device->convert.needed) {
|
||||||
device->convert.len = (int) (((double) device->spec.size) /
|
device->convert.len = (int) (((double) device->spec.samples) /
|
||||||
device->convert.len_ratio);
|
device->convert.len_ratio);
|
||||||
|
device->convert.len *= SDL_AUDIO_BITSIZE(device->spec.format) / 8;
|
||||||
|
device->convert.len *= device->spec.channels;
|
||||||
|
|
||||||
device->convert.buf =
|
device->convert.buf =
|
||||||
(Uint8 *) SDL_malloc(device->convert.len *
|
(Uint8 *) SDL_malloc(device->convert.len *
|
||||||
|
|
Loading…
Reference in New Issue