From 439ae26683658a9db7d8486d086a88f14301ea05 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sat, 8 Dec 2012 19:44:04 +0000 Subject: [PATCH] Fix HLS bits per second --- src/com/upc/pbe/upcnews/BandwidthMeasurer.java | 2 +- src/com/upc/pbe/upcnews/HLS.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/upc/pbe/upcnews/BandwidthMeasurer.java b/src/com/upc/pbe/upcnews/BandwidthMeasurer.java index 12a879f..0e8cdbd 100644 --- a/src/com/upc/pbe/upcnews/BandwidthMeasurer.java +++ b/src/com/upc/pbe/upcnews/BandwidthMeasurer.java @@ -16,7 +16,7 @@ public class BandwidthMeasurer if(rxDiff != 0) { - bps = (rxDiff / (TimeDifference/1000)); // total rx bytes per second. + bps = ((rxDiff*8) / (TimeDifference/1000)); // total rx bits per second. } else { diff --git a/src/com/upc/pbe/upcnews/HLS.java b/src/com/upc/pbe/upcnews/HLS.java index a66c859..d21ff38 100644 --- a/src/com/upc/pbe/upcnews/HLS.java +++ b/src/com/upc/pbe/upcnews/HLS.java @@ -41,7 +41,7 @@ public class HLS { //long segmentBytes = fd.Download(seg.getURL(),localFolder); long segmentBytes = 0; double bps = bm.Measure(segmentBytes,startTime); - if(bps < qualities.get(currentQuality).getQuality()) + if((bps < qualities.get(currentQuality).getQuality()) && (bps != -1)) { currentQuality++; break; -- libgit2 0.22.2