Commit 439ae26683658a9db7d8486d086a88f14301ea05
1 parent
14a9a44e
Fix HLS bits per second
Showing
2 changed files
with
2 additions
and
2 deletions
src/com/upc/pbe/upcnews/BandwidthMeasurer.java
@@ -16,7 +16,7 @@ public class BandwidthMeasurer | @@ -16,7 +16,7 @@ public class BandwidthMeasurer | ||
16 | 16 | ||
17 | if(rxDiff != 0) | 17 | if(rxDiff != 0) |
18 | { | 18 | { |
19 | - bps = (rxDiff / (TimeDifference/1000)); // total rx bytes per second. | 19 | + bps = ((rxDiff*8) / (TimeDifference/1000)); // total rx bits per second. |
20 | } | 20 | } |
21 | else | 21 | else |
22 | { | 22 | { |
src/com/upc/pbe/upcnews/HLS.java
@@ -41,7 +41,7 @@ public class HLS { | @@ -41,7 +41,7 @@ public class HLS { | ||
41 | //long segmentBytes = fd.Download(seg.getURL(),localFolder); | 41 | //long segmentBytes = fd.Download(seg.getURL(),localFolder); |
42 | long segmentBytes = 0; | 42 | long segmentBytes = 0; |
43 | double bps = bm.Measure(segmentBytes,startTime); | 43 | double bps = bm.Measure(segmentBytes,startTime); |
44 | - if(bps < qualities.get(currentQuality).getQuality()) | 44 | + if((bps < qualities.get(currentQuality).getQuality()) && (bps != -1)) |
45 | { | 45 | { |
46 | currentQuality++; | 46 | currentQuality++; |
47 | break; | 47 | break; |