mirror of
https://github.com/ericonr/sndio.git
synced 2024-02-18 04:45:21 -06:00
merge from HEAD
This commit is contained in:
parent
01a52357c2
commit
b9c0f17f1b
@ -532,6 +532,8 @@ slot_mix_badd(struct slot *s, adata_t *odata)
|
||||
while (otodo > 0) {
|
||||
idata = (adata_t *)abuf_rgetblk(&s->buf, &len);
|
||||
icnt = len / s->bpf;
|
||||
if (icnt > s->round)
|
||||
icnt = s->round;
|
||||
ocnt = otodo;
|
||||
slot_getcnt(s, &icnt, &ocnt);
|
||||
if (icnt == 0)
|
||||
@ -606,6 +608,8 @@ slot_sub_bcopy(struct slot *s, adata_t *idata, int itodo)
|
||||
while (itodo > 0) {
|
||||
odata = (adata_t *)abuf_wgetblk(&s->buf, &len);
|
||||
ocnt = len / s->bpf;
|
||||
if (ocnt > s->round)
|
||||
ocnt = s->round;
|
||||
icnt = itodo;
|
||||
slot_getcnt(s, &icnt, &ocnt);
|
||||
if (ocnt == 0)
|
||||
|
10
aucat/dsp.c
10
aucat/dsp.c
@ -288,7 +288,7 @@ resamp_getcnt(struct resamp *p, int *icnt, int *ocnt)
|
||||
|
||||
/*
|
||||
* Resample the given number of frames. The number of output frames
|
||||
* must match the coresponding number the input frames. Either always
|
||||
* must match the coresponding number of input frames. Either always
|
||||
* use icnt and ocnt such that:
|
||||
*
|
||||
* icnt * oblksz = ocnt * iblksz
|
||||
@ -407,14 +407,14 @@ resamp_init(struct resamp *p, unsigned int iblksz,
|
||||
unsigned int i, g;
|
||||
|
||||
/*
|
||||
* reduice iblksz/oblksz fraction
|
||||
* reduce iblksz/oblksz fraction
|
||||
*/
|
||||
g = uint_gcd(iblksz, oblksz);
|
||||
iblksz /= g;
|
||||
oblksz /= g;
|
||||
|
||||
/*
|
||||
* ensure weired rates dont cause integer overflows
|
||||
* ensure weird rates don't cause integer overflow
|
||||
*/
|
||||
while (iblksz > ADATA_UNIT || oblksz > ADATA_UNIT) {
|
||||
iblksz >>= 1;
|
||||
@ -587,7 +587,7 @@ enc_init(struct conv *p, struct aparams *par, int nch)
|
||||
}
|
||||
|
||||
/*
|
||||
* decode "todo" frames from from foreign to native encoding
|
||||
* decode "todo" frames from foreign to native encoding
|
||||
*/
|
||||
void
|
||||
dec_do(struct conv *p, unsigned char *in, unsigned char *out, int todo)
|
||||
@ -829,7 +829,7 @@ cmap_add(struct cmap *p, void *in, void *out, int vol, int todo)
|
||||
}
|
||||
|
||||
/*
|
||||
* overwrite output with "todo" input frames with with the given volume
|
||||
* overwrite output with "todo" input frames with the given volume
|
||||
*/
|
||||
void
|
||||
cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo)
|
||||
|
Loading…
Reference in New Issue
Block a user