Call slot_stop() after the play buffer is drained to properly cleanup
authorratchov <ratchov@openbsd.org>
Sat, 16 May 2015 19:27:53 +0000 (19:27 +0000)
committerratchov <ratchov@openbsd.org>
Sat, 16 May 2015 19:27:53 +0000 (19:27 +0000)
the slot. Fixes periodic glitches occurring after eof is reached, and
then playback restarted with a MMC-relocate and MMC-start.

usr.bin/aucat/aucat.c

index e62ac2f..ab52872 100644 (file)
@@ -917,13 +917,13 @@ slot_list_mix(unsigned int round, unsigned int pchan, adata_t *pbuf)
                if (s->pstate == SLOT_INIT || !(s->mode & SIO_PLAY))
                        continue;
                if (s->pstate == SLOT_STOP && s->buf.used < s->bpf) {
-                       s->pstate = SLOT_INIT;
 #ifdef DEBUG
                        if (log_level >= 3) {
                                slot_log(s);
                                log_puts(": drained, done\n");
                        }
 #endif
+                       slot_stop(s);
                        continue;
                }
                n = slot_mix_badd(s, dev_pbuf);