mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-31 01:00:53 +00:00
Format fluid_synth_write_*()
This commit is contained in:
parent
988ec6d799
commit
171f3396a4
1 changed files with 22 additions and 14 deletions
|
@ -3814,10 +3814,10 @@ fluid_synth_write_float(fluid_synth_t *synth, int len,
|
||||||
|
|
||||||
int
|
int
|
||||||
fluid_synth_write_float_LOCAL(fluid_synth_t *synth, int len,
|
fluid_synth_write_float_LOCAL(fluid_synth_t *synth, int len,
|
||||||
void *lout, int loff, int lincr,
|
void *lout, int loff, int lincr,
|
||||||
void *rout, int roff, int rincr,
|
void *rout, int roff, int rincr,
|
||||||
int (*block_render_func)(fluid_synth_t *, int)
|
int (*block_render_func)(fluid_synth_t *, int)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int n, cur, size;
|
int n, cur, size;
|
||||||
float *left_out = (float *) lout + loff;
|
float *left_out = (float *) lout + loff;
|
||||||
|
@ -3856,12 +3856,16 @@ fluid_synth_write_float_LOCAL(fluid_synth_t *synth, int len,
|
||||||
n = synth->curmax - cur;
|
n = synth->curmax - cur;
|
||||||
|
|
||||||
/* keep track of emitted samples */
|
/* keep track of emitted samples */
|
||||||
if (n > size) n = size;
|
if(n > size)
|
||||||
|
{
|
||||||
|
n = size;
|
||||||
|
}
|
||||||
|
|
||||||
size -= n;
|
size -= n;
|
||||||
|
|
||||||
/* update pointers to current position */
|
/* update pointers to current position */
|
||||||
left_in += cur+n;
|
left_in += cur + n;
|
||||||
right_in += cur+n;
|
right_in += cur + n;
|
||||||
|
|
||||||
/* set final cursor position */
|
/* set final cursor position */
|
||||||
cur += n;
|
cur += n;
|
||||||
|
@ -3877,9 +3881,9 @@ fluid_synth_write_float_LOCAL(fluid_synth_t *synth, int len,
|
||||||
left_out += lincr;
|
left_out += lincr;
|
||||||
right_out += rincr;
|
right_out += rincr;
|
||||||
}
|
}
|
||||||
while (++n < 0);
|
while(++n < 0);
|
||||||
}
|
}
|
||||||
while (size);
|
while(size);
|
||||||
|
|
||||||
synth->cur = cur;
|
synth->cur = cur;
|
||||||
|
|
||||||
|
@ -4011,12 +4015,16 @@ fluid_synth_write_s16(fluid_synth_t *synth, int len,
|
||||||
n = synth->curmax - cur;
|
n = synth->curmax - cur;
|
||||||
|
|
||||||
/* keep track of emitted samples */
|
/* keep track of emitted samples */
|
||||||
if (n > size) n = size;
|
if(n > size)
|
||||||
|
{
|
||||||
|
n = size;
|
||||||
|
}
|
||||||
|
|
||||||
size -= n;
|
size -= n;
|
||||||
|
|
||||||
/* update pointers to current position */
|
/* update pointers to current position */
|
||||||
left_in += cur+n;
|
left_in += cur + n;
|
||||||
right_in += cur+n;
|
right_in += cur + n;
|
||||||
|
|
||||||
/* set final cursor position */
|
/* set final cursor position */
|
||||||
cur += n;
|
cur += n;
|
||||||
|
@ -4037,9 +4045,9 @@ fluid_synth_write_s16(fluid_synth_t *synth, int len,
|
||||||
di = 0;
|
di = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (++n < 0);
|
while(++n < 0);
|
||||||
}
|
}
|
||||||
while (size);
|
while(size);
|
||||||
|
|
||||||
synth->cur = cur;
|
synth->cur = cur;
|
||||||
synth->dither_index = di; /* keep dither buffer continous */
|
synth->dither_index = di; /* keep dither buffer continous */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue