From 8a5b6bf798581bdf49e39084f456bce07c01b498 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 6 Jun 2011 08:24:08 +0200 Subject: [PATCH] alsa: Avoid busy loop at end of file. During the drain period at the end of input the status of the alsa buffer tree node is negative, yet we should not request a minimal scheduler delay until the end of this period. --- alsa_write.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alsa_write.c b/alsa_write.c index 047eeaa3..1c168e7b 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -150,8 +150,10 @@ static void alsa_write_pre_select(struct sched *s, struct task *t) if (ret == 0) return; - if (ret < 0 || !pad) + if (!pad) return sched_min_delay(s); + if (ret < 0) + return sched_request_barrier_or_min_delay(&pad->drain_barrier, s); /* * Data is available to be written to the alsa handle. Compute number * of milliseconds until next buffer underrun would occur. -- 2.39.2