summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-05-06 15:16:28 -0700
committerChong Zhang <chz@google.com>2015-05-06 18:28:40 -0700
commit8a048338d9291b2db1b3a325fff58cb1aa69f04d (patch)
tree02bb0051275a15fb99377bfa9e06b9b3d0071599 /media/libstagefright/httplive
parent32fa6d0e65dbf956e253a1006e9419dce2fe75c9 (diff)
downloadframeworks_av-8a048338d9291b2db1b3a325fff58cb1aa69f04d.zip
frameworks_av-8a048338d9291b2db1b3a325fff58cb1aa69f04d.tar.gz
frameworks_av-8a048338d9291b2db1b3a325fff58cb1aa69f04d.tar.bz2
nuplayer: fixes for subtitle pause/resume
- pause after the current block when select track - ignore metadata timestamps as they're too sparse - use smaller range when searching for next segment to prevent resumeUntil from downloading too much data bug: 20500732 Change-Id: Ibda57a39ec86efd96a8dd0db95adeb92d076697a
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp3
-rw-r--r--media/libstagefright/httplive/PlaylistFetcher.cpp11
2 files changed, 11 insertions, 3 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index d8c38e7..64a8532 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -1503,11 +1503,10 @@ void LiveSession::changeConfiguration(
ALOGV("discarding fetcher-%d", fetcher->getFetcherID());
fetcher->stopAsync();
} else {
- float threshold = -1.0f; // always finish fetching by default
+ float threshold = 0.0f; // default to pause after current block (47Kbytes)
bool disconnect = false;
if (timeUs >= 0ll) {
// seeking, no need to finish fetching
- threshold = 0.0f;
disconnect = true;
} else if (delayRemoval) {
// adapting, abort if remaining of current segment is over threshold
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp
index 53087b6..5a0deec 100644
--- a/media/libstagefright/httplive/PlaylistFetcher.cpp
+++ b/media/libstagefright/httplive/PlaylistFetcher.cpp
@@ -1424,11 +1424,17 @@ bool PlaylistFetcher::adjustSeqNumberWithAnchorTime(int64_t anchorTimeUs) {
int64_t minDiffUs, maxDiffUs;
if (mSeekMode == LiveSession::kSeekModeNextSample) {
+ // if the previous fetcher paused in the middle of a segment, we
+ // want to start at a segment that overlaps the last sample
minDiffUs = -mPlaylist->getTargetDuration();
maxDiffUs = 0ll;
} else {
+ // if the previous fetcher paused at the end of a segment, ideally
+ // we want to start at the segment that's roughly aligned with its
+ // next segment, but if the two variants are not well aligned we
+ // adjust the diff to within (-T/2, T/2)
minDiffUs = -mPlaylist->getTargetDuration() / 2;
- maxDiffUs = mPlaylist->getTargetDuration();
+ maxDiffUs = mPlaylist->getTargetDuration() / 2;
}
int32_t oldSeqNumber = mSeqNumber;
@@ -1611,6 +1617,9 @@ status_t PlaylistFetcher::extractAndQueueAccessUnitsFromTs(const sp<ABuffer> &bu
ALOGE("MPEG2 Transport streams do not contain subtitles.");
return ERROR_MALFORMED;
}
+ if (stream == LiveSession::STREAMTYPE_METADATA) {
+ continue;
+ }
ATSParser::SourceType type =LiveSession::getSourceTypeForStream(stream);
sp<AnotherPacketSource> source =
static_cast<AnotherPacketSource *>(