summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-10 00:27:14 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-10 00:27:15 +0000
commit0ad38cd9674f2f7180d3310820d7dd2820159320 (patch)
treeaf0680dfb706d031363d93b3f548636e85856292 /media
parentd4db9dcd7d29234893d580c329f23242197fe664 (diff)
parent358e71747a4707f9429b8565a05482c1f68d0ed3 (diff)
downloadframeworks_av-0ad38cd9674f2f7180d3310820d7dd2820159320.zip
frameworks_av-0ad38cd9674f2f7180d3310820d7dd2820159320.tar.gz
frameworks_av-0ad38cd9674f2f7180d3310820d7dd2820159320.tar.bz2
Merge "do not do bandwidth estimation if total data downloaded is too small"
Diffstat (limited to 'media')
-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;
}