sad

simple audio daemon
git clone git://git.2f30.org/sad.git
Log | Files | Refs | LICENSE

commit bdc79c7ecede269770677d3645ba27a521b673eb
parent 9071e7aaf3a12ea712e22d17d261b51766d9f7f6
Author: sin <sin@2f30.org>
Date:   Thu Dec 25 15:25:19 +0000

Reset state on failure

Diffstat:
sad.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sad.c b/sad.c @@ -70,11 +70,14 @@ doaudio(void) switch (s->state) { case PREPARE: - decoder->open(s->path); + if (decoder->open(s->path) < 0) { + s->state = NONE; + return; + } s->state = PLAYING; break; case PLAYING: - if (decoder->decode() == 0) { + if (decoder->decode() <= 0) { decoder->close(); s->state = NONE; }