summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-09 09:08:15 -0700
committerChong Zhang <chz@google.com>2015-03-09 12:54:04 -0700
commit358e71747a4707f9429b8565a05482c1f68d0ed3 (patch)
treeedc759e31576e30b496d908cf88df582477e7b3e
parentb9a23184272a75f1585e8dd64eeccc3a3e621d5f (diff)
downloadframeworks_av-358e71747a4707f9429b8565a05482c1f68d0ed3.zip
frameworks_av-358e71747a4707f9429b8565a05482c1f68d0ed3.tar.gz
frameworks_av-358e71747a4707f9429b8565a05482c1f68d0ed3.tar.bz2
do not do bandwidth estimation if total data downloaded is too small
bug: 19656539 Change-Id: I0ab9baad31e8953224a37d5aaf816e44780191c0
-rw-r--r--media/libstagefright/HTTPBase.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/media/libstagefright/HTTPBase.cpp b/media/libstagefright/HTTPBase.cpp
index 0c2ff15..77a652a 100644
--- a/media/libstagefright/HTTPBase.cpp
+++ b/media/libstagefright/HTTPBase.cpp
@@ -75,7 +75,11 @@ void HTTPBase::addBandwidthMeasurement(
bool HTTPBase::estimateBandwidth(int32_t *bandwidth_bps) {
Mutex::Autolock autoLock(mLock);
- if (mNumBandwidthHistoryItems < 2) {
+ // Do not do bandwidth estimation if we don't have enough samples, or
+ // total bytes download are too small (<64K).
+ // Bandwidth estimation from these samples can often shoot up and cause
+ // unwanted bw adaption behaviors.
+ if (mNumBandwidthHistoryItems < 2 || mTotalTransferBytes < 65536) {
return false;
}