summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorApurupa Pattapu <apurupa@codeaurora.org>2014-12-05 09:45:43 -0800
committerRobert Shih <robertshih@google.com>2015-01-30 18:19:32 -0800
commit678bcdc852dd8f801f5c46fdc85db587b721d83d (patch)
tree1a9b9056fde9c618097093dc15437c8df68c5475 /media/libstagefright/httplive
parent1bf8a21018cc1d95dc3c28b5044aeda327c7b54e (diff)
downloadframeworks_av-678bcdc852dd8f801f5c46fdc85db587b721d83d.zip
frameworks_av-678bcdc852dd8f801f5c46fdc85db587b721d83d.tar.gz
frameworks_av-678bcdc852dd8f801f5c46fdc85db587b721d83d.tar.bz2
httplive: Defer switch down if a switch is in progress
Bandwidth switch down is triggered if the buffered duration in any of the current packet sources is below a threshold. When a switch is in progress, all the packet sources are drained until they are empty or until stop time is dequeued. Hence buffered duration keeps going down during switch. Defering check switch down will avoid unnecessary switches. Do not switch down if estimated bandwidth index is more than the current one. Bug: 18821145 Change-Id: I655a308462503cf9df10672ecd904a51b2cba691
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 9daab3b..2c1fbb4 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -1628,6 +1628,12 @@ void LiveSession::onCheckSwitchDown() {
return;
}
+ if (mSwitchInProgress || mReconfigurationInProgress) {
+ ALOGV("Switch/Reconfig in progress, defer switch down");
+ mSwitchDownMonitor->post(1000000ll);
+ return;
+ }
+
for (size_t i = 0; i < kMaxStreams; ++i) {
int32_t targetDuration;
sp<AnotherPacketSource> packetSource = mPacketSources.valueFor(indexToType(i));
@@ -1658,7 +1664,6 @@ void LiveSession::onSwitchDown() {
return;
}
- changeConfiguration(-1, mCurBandwidthIndex - 1, false);
}
// Mark switch done when: