From: Andre Noll Date: Sun, 10 Feb 2008 13:20:09 +0000 (+0100) Subject: Speed up audiod_pre_select. X-Git-Tag: v0.3.1~23 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=19e10ff96914706d93f3c92bc325dc6ec62a8508;ds=sidebyside Speed up audiod_pre_select. Catch the common case early in the function to minimize the number of checks for that case. --- diff --git a/audiod.c b/audiod.c index 701f8278..dee31d5c 100644 --- a/audiod.c +++ b/audiod.c @@ -599,6 +599,8 @@ static void audiod_pre_select(struct sched *s, __a_unused struct task *t) a = &afi[sl->format]; if (!sl->receiver_node) continue; + if ((!a->num_filters || sl->fc) && sl->wng) + continue; /* everything already started */ if (!a->num_filters) { if (sl->receiver_node->loaded && !sl->wng) { open_writers(i); @@ -611,7 +613,7 @@ static void audiod_pre_select(struct sched *s, __a_unused struct task *t) s->timeout = min_delay; continue; } - if (!sl->fc || !*sl->fc->out_loaded || sl->wng) + if (sl->wng || !sl->fc || !*sl->fc->out_loaded) continue; if (tv_diff(now, &initial_delay_barrier, &diff) > 0) { open_writers(i);