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:
Alexandre Ratchov 2017-11-03 16:10:48 +01:00
parent 944568234a
commit b06285beda
2 changed files with 8 additions and 0 deletions

View File

@ -346,6 +346,10 @@ slot_init(struct slot *s)
enc_init(&s->conv, &s->afile.par, slot_nch);
s->convbuf =
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;

View File

@ -1710,6 +1710,10 @@ slot_attach(struct slot *s)
enc_init(&s->sub.enc, &s->par, slot_nch);
s->sub.encbuf =
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));
}
/*