fix alsa driver with custom callback

This commit is contained in:
derselbst 2018-07-11 21:05:12 +02:00
parent c4f0b19c64
commit b46998ba04

View file

@ -457,8 +457,8 @@ static fluid_thread_return_t fluid_alsa_audio_run_float(void *d)
{ {
while(dev->cont) while(dev->cont)
{ {
FLUID_MEMSET(left, 0, buffer_size * sizeof(float)); FLUID_MEMSET(left, 0, buffer_size * sizeof(*left));
FLUID_MEMSET(right, 0, buffer_size * sizeof(float)); FLUID_MEMSET(right, 0, buffer_size * sizeof(*right));
handle[0] = left; handle[0] = left;
handle[1] = right; handle[1] = right;
@ -563,6 +563,9 @@ static fluid_thread_return_t fluid_alsa_audio_run_s16(void *d)
while(dev->cont) while(dev->cont)
{ {
FLUID_MEMSET(left, 0, buffer_size * sizeof(*left));
FLUID_MEMSET(right, 0, buffer_size * sizeof(*right));
(*dev->callback)(dev->data, buffer_size, 0, NULL, 2, handle); (*dev->callback)(dev->data, buffer_size, 0, NULL, 2, handle);
/* convert floating point data to 16 bit (with dithering) */ /* convert floating point data to 16 bit (with dithering) */