summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-01-05 16:24:27 -0800
committerAndreas Huber <andih@google.com>2011-01-05 16:24:27 -0800
commit22fc52f6f72f39e33c3970d0291de3569118aa5c (patch)
tree3f446d7a2aa1e0e701b0ce33a10175547eb29bdf /media/libstagefright/httplive
parent43c3e6ce02215ca99d506458f596cb1211639f29 (diff)
downloadframeworks_av-22fc52f6f72f39e33c3970d0291de3569118aa5c.zip
frameworks_av-22fc52f6f72f39e33c3970d0291de3569118aa5c.tar.gz
frameworks_av-22fc52f6f72f39e33c3970d0291de3569118aa5c.tar.bz2
Some more fixes regarding HTTP live in NuPlayer.
Change-Id: I9e29615fa8ee6c7bd4189373a75c20caef3fd2b1
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 51ab7a1..6fd0171 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -385,6 +385,7 @@ void LiveSession::onDownloadNext() {
}
bool explicitDiscontinuity = false;
+ bool bandwidthChanged = false;
if (mSeekTimeUs >= 0) {
int32_t targetDuration;
@@ -404,7 +405,14 @@ void LiveSession::onDownloadNext() {
mDataSource->reset();
+ // reseting the data source will have had the
+ // side effect of discarding any previously queued
+ // bandwidth change discontinuity.
+ // Therefore we'll need to treat these explicit
+ // discontinuities as involving a bandwidth change
+ // even if they aren't directly.
explicitDiscontinuity = true;
+ bandwidthChanged = true;
}
}
}
@@ -484,9 +492,15 @@ void LiveSession::onDownloadNext() {
return;
}
- bool bandwidthChanged =
- mPrevBandwidthIndex >= 0
- && (size_t)mPrevBandwidthIndex != bandwidthIndex;
+ if ((size_t)mPrevBandwidthIndex != bandwidthIndex) {
+ bandwidthChanged = true;
+ }
+
+ if (mPrevBandwidthIndex < 0) {
+ // Don't signal a bandwidth change at the very beginning of
+ // playback.
+ bandwidthChanged = false;
+ }
if (explicitDiscontinuity || bandwidthChanged) {
// Signal discontinuity.