From 414e011cf6e894ec7b87da60ae287fba44e388b0 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sat, 9 Jun 2018 08:33:24 +0200 Subject: [PATCH] sndiod: remove handling of unreachable state in slot_stop() --- sndiod/dev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index d13ba28..5bdcfdf 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -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);