]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Bias quality to avoid exposure of transient errors
authorAndreas Öman <andreas@lonelycoder.com>
Tue, 6 May 2008 19:13:08 +0000 (19:13 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Tue, 6 May 2008 19:13:08 +0000 (19:13 +0000)
transports.c

index 8b7275f2b5aa7d81c74e1432bb9d4543e774acd3..19da2cd3e96f9470b539a886641a4a47f4addce6 100644 (file)
@@ -248,11 +248,14 @@ transport_get_prio(th_transport_t *t)
  *
  * But for sorting, we want low numbers first
  *
+ * Also, we bias and trim with an offset of two to avoid counting any
+ * transient errors.
  */
+
 static int
 transport_get_quality(th_transport_t *t)
 {
-  return t->tht_quality_index ? -(t->tht_quality_index(t)) : 0;
+  return t->tht_quality_index ? -MIN(t->tht_quality_index(t) + 2, 0) : 0;
 }