mirror of https://github.com/ericonr/sndio.git
sndiod: Reset skip counter in slot_start().
This commit is contained in:
parent
ed64776ceb
commit
6bc6041b30
16
sndiod/dev.c
16
sndiod/dev.c
|
@ -1774,17 +1774,10 @@ slot_attach(struct slot *s)
|
||||||
#endif
|
#endif
|
||||||
s->next = d->slot_list;
|
s->next = d->slot_list;
|
||||||
d->slot_list = s;
|
d->slot_list = s;
|
||||||
s->skip = 0;
|
|
||||||
if (s->mode & MODE_PLAY) {
|
if (s->mode & MODE_PLAY) {
|
||||||
s->mix.vol = MIDI_TO_ADATA(s->vol);
|
s->mix.vol = MIDI_TO_ADATA(s->vol);
|
||||||
dev_mix_adjvol(d);
|
dev_mix_adjvol(d);
|
||||||
}
|
}
|
||||||
if (s->mode & MODE_RECMASK) {
|
|
||||||
/*
|
|
||||||
* N-th recorded block is the N-th played block
|
|
||||||
*/
|
|
||||||
s->sub.prime = -startpos / (int)s->round;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1841,6 +1834,15 @@ slot_start(struct slot *s)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
slot_allocbufs(s);
|
slot_allocbufs(s);
|
||||||
|
|
||||||
|
if (s->mode & MODE_RECMASK) {
|
||||||
|
/*
|
||||||
|
* N-th recorded block is the N-th played block
|
||||||
|
*/
|
||||||
|
s->sub.prime = -dev_getpos(s->dev) / s->dev->round;
|
||||||
|
}
|
||||||
|
s->skip = 0;
|
||||||
|
|
||||||
if (s->mode & MODE_PLAY) {
|
if (s->mode & MODE_PLAY) {
|
||||||
s->pstate = SLOT_START;
|
s->pstate = SLOT_START;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue