summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/PlaylistFetcher.cpp
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-02-04 21:24:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-04 21:24:24 +0000
commita291dabcab10cafc1749d1d9493d269049502256 (patch)
treedf0f06ceb047ecdb6f8d1d1f6ddc271656ae37b9 /media/libstagefright/httplive/PlaylistFetcher.cpp
parent7b66f713fc53ee81453763788c02f3c741d19520 (diff)
parent6fbcf6331abfbbc935bf89332f84303733e578b2 (diff)
downloadframeworks_av-a291dabcab10cafc1749d1d9493d269049502256.zip
frameworks_av-a291dabcab10cafc1749d1d9493d269049502256.tar.gz
frameworks_av-a291dabcab10cafc1749d1d9493d269049502256.tar.bz2
am 6fbcf633: Merge "httplive: Set start time and segment start time in conjunction." into lmp-mr1-dev
* commit '6fbcf6331abfbbc935bf89332f84303733e578b2': httplive: Set start time and segment start time in conjunction.
Diffstat (limited to 'media/libstagefright/httplive/PlaylistFetcher.cpp')
-rw-r--r--media/libstagefright/httplive/PlaylistFetcher.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp
index 9202ffa..00e52ee 100644
--- a/media/libstagefright/httplive/PlaylistFetcher.cpp
+++ b/media/libstagefright/httplive/PlaylistFetcher.cpp
@@ -758,6 +758,9 @@ void PlaylistFetcher::onDownloadNext() {
mSeqNumber = firstSeqNumberInPlaylist;
}
} else {
+ // When seeking mSegmentStartTimeUs is unavailable (< 0), we
+ // use mStartTimeUs (client supplied timestamp) to determine both start segment
+ // and relative position inside a segment
mSeqNumber = getSeqNumberForTime(mStartTimeUs);
mStartTimeUs -= getSegmentStartTimeUs(mSeqNumber);
}
@@ -766,6 +769,10 @@ void PlaylistFetcher::onDownloadNext() {
mStartTimeUs, mSeqNumber, firstSeqNumberInPlaylist,
lastSeqNumberInPlaylist);
} else {
+ // When adapting or track switching, mSegmentStartTimeUs (relative
+ // to media time 0) is used to determine the start segment; mStartTimeUs (absolute
+ // timestamps coming from the media container) is used to determine the position
+ // inside a segments.
mSeqNumber = getSeqNumberForTime(mSegmentStartTimeUs);
if (mAdaptive) {
// avoid double fetch/decode