mirror of https://github.com/ericonr/sndio.git
Prefill with silence rec buffer.
This is necessary as certain channels may not receive samples, for instance when mono->stereo conversion is disabled.
This commit is contained in:
parent
944568234a
commit
b06285beda
|
@ -346,6 +346,10 @@ slot_init(struct slot *s)
|
||||||
enc_init(&s->conv, &s->afile.par, slot_nch);
|
enc_init(&s->conv, &s->afile.par, slot_nch);
|
||||||
s->convbuf =
|
s->convbuf =
|
||||||
xmalloc(s->round * slot_nch * sizeof(adata_t));
|
xmalloc(s->round * slot_nch * sizeof(adata_t));
|
||||||
|
enc_sil_do(&s->conv, s->buf.data, bufsz);
|
||||||
|
} else {
|
||||||
|
memset(s->buf.data, 0,
|
||||||
|
bufsz * slot_nch * sizeof(adata_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s->pstate = SLOT_INIT;
|
s->pstate = SLOT_INIT;
|
||||||
|
|
|
@ -1710,6 +1710,10 @@ slot_attach(struct slot *s)
|
||||||
enc_init(&s->sub.enc, &s->par, slot_nch);
|
enc_init(&s->sub.enc, &s->par, slot_nch);
|
||||||
s->sub.encbuf =
|
s->sub.encbuf =
|
||||||
xmalloc(s->round * slot_nch * sizeof(adata_t));
|
xmalloc(s->round * slot_nch * sizeof(adata_t));
|
||||||
|
enc_sil_do(&s->sub.enc, s->sub.buf.data, s->appbufsz);
|
||||||
|
} else {
|
||||||
|
memset(s->sub.buf.data, 0,
|
||||||
|
s->appbufsz * slot_nch * sizeof(adata_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue