[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [54] Fixes for preferred HD links when there ar
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [54] Fixes for preferred HD links when there are only two links. |
Date: |
Mon, 02 May 2011 10:16:39 +0000 |
Revision: 54
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=54
Author: valkov
Date: 2011-05-02 10:16:38 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Fixes for preferred HD links when there are only two links.
Modified Paths:
--------------
trunk/src/lm_compute_preferred_hd_link.js
Modified: trunk/src/lm_compute_preferred_hd_link.js
===================================================================
--- trunk/src/lm_compute_preferred_hd_link.js 2011-05-02 09:07:02 UTC (rev 53)
+++ trunk/src/lm_compute_preferred_hd_link.js 2011-05-02 10:16:38 UTC (rev 54)
@@ -58,5 +58,21 @@
preferred_link_index = Math.floor(((hd_links.length)*quality));
}
+ // Ensure correct index. The hd_links.length is greater by one
+ // then the number of links.
+ if (preferred_link_index == 0)
+ {
+ preferred_link_index = 1;
+ }
+
+ // Special case for two links and quality > 50%. The rounding
+ // makes the second link available after 75%. That is not what we
+ // want.
+ if (Math.abs(this.preferred_hd_quality) > 0.5 &&
+ hd_links.length == 2)
+ {
+ preferred_link_index = hd_links.length;
+ }
+
return Math.abs(hd_links.length-preferred_link_index);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [54] Fixes for preferred HD links when there are only two links.,
Ivaylo Valkov <=