mirror of https://github.com/ericonr/sndio.git
Merge branch 'master' into mixer
This commit is contained in:
commit
40da2ff2b7
|
@ -346,7 +346,20 @@ 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* cmap_copy() doesn't write samples in all channels,
|
||||
* for instance when mono->stereo conversion is
|
||||
* disabled. So we have to prefill cmap_copy() output
|
||||
* with silence.
|
||||
*/
|
||||
if (s->resampbuf) {
|
||||
memset(s->resampbuf, 0,
|
||||
dev_round * slot_nch * sizeof(adata_t));
|
||||
} else if (s->convbuf) {
|
||||
memset(s->convbuf, 0,
|
||||
s->round * slot_nch * sizeof(adata_t));
|
||||
} else {
|
||||
memset(s->buf.data, 0,
|
||||
bufsz * slot_nch * sizeof(adata_t));
|
||||
|
|
15
sndiod/dev.c
15
sndiod/dev.c
|
@ -1763,7 +1763,20 @@ 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* cmap_copy() doesn't write samples in all channels,
|
||||
* for instance when mono->stereo conversion is
|
||||
* disabled. So we have to prefill cmap_copy() output
|
||||
* with silence.
|
||||
*/
|
||||
if (s->sub.resampbuf) {
|
||||
memset(s->sub.resampbuf, 0,
|
||||
d->round * slot_nch * sizeof(adata_t));
|
||||
} else if (s->sub.encbuf) {
|
||||
memset(s->sub.encbuf, 0,
|
||||
s->round * slot_nch * sizeof(adata_t));
|
||||
} else {
|
||||
memset(s->sub.buf.data, 0,
|
||||
s->appbufsz * slot_nch * sizeof(adata_t));
|
||||
|
|
Loading…
Reference in New Issue