audiod: Fix bug in status_pre_select().
authorAndre Noll <maan@systemlinux.org>
Fri, 23 Dec 2011 20:51:00 +0000 (21:51 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 4 Jan 2012 14:44:25 +0000 (15:44 +0100)
We have to take the minimum input size into account when deciding
whether a minimal delay should be requested from the scheduler.
Without this, a busy loop is possible.

audiod.c

index 88411af..4858366 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -1159,7 +1159,7 @@ static void status_pre_select(struct sched *s, struct task *t)
 
        if (must_start_decoder())
                goto min_delay;
-       ret = btr_node_status(st->btrn, 0, BTR_NT_LEAF);
+       ret = btr_node_status(st->btrn, st->min_iqs, BTR_NT_LEAF);
        if (ret > 0)
                goto min_delay;
        if (st->ct && audiod_status == AUDIOD_OFF)