sndiod: remove handling of unreachable state in slot_stop()

This commit is contained in:
Alexandre Ratchov 2018-06-09 08:33:24 +02:00
parent eb847f40b4
commit 414e011cf6
1 changed files with 7 additions and 5 deletions

View File

@ -1867,11 +1867,13 @@ slot_stop(struct slot *s)
}
#endif
if (s->pstate == SLOT_START) {
if (s->mode & MODE_PLAY) {
s->pstate = SLOT_READY;
slot_ready(s);
} else
s->pstate = SLOT_INIT;
/*
* If in rec-only mode, we're already in the READY or
* RUN states. We're here because the play buffer was
* not full enough, try to start so it's drained.
*/
s->pstate = SLOT_READY;
slot_ready(s);
}
if (s->mode & MODE_RECMASK)
abuf_done(&s->sub.buf);