sndiod: Reset skip counter in slot_start().

This commit is contained in:
Alexandre Ratchov 2018-06-11 19:53:32 +02:00
parent ed64776ceb
commit 6bc6041b30
1 changed files with 9 additions and 7 deletions

View File

@ -1774,17 +1774,10 @@ slot_attach(struct slot *s)
#endif
s->next = d->slot_list;
d->slot_list = s;
s->skip = 0;
if (s->mode & MODE_PLAY) {
s->mix.vol = MIDI_TO_ADATA(s->vol);
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
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) {
s->pstate = SLOT_START;
} else {