summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-11-16 10:32:13 -0800
committerAndreas Huber <andih@google.com>2010-11-16 10:32:13 -0800
commit6f9f029f7fc625bb2a1b448ad30a80a6a6a73b20 (patch)
tree2f41ad0adac65e577c5514b33585705d64a47bbe /media/libstagefright/httplive
parent8fff6bb0000e43f02c9d04ca90f941fdefdc1356 (diff)
downloadframeworks_av-6f9f029f7fc625bb2a1b448ad30a80a6a6a73b20.zip
frameworks_av-6f9f029f7fc625bb2a1b448ad30a80a6a6a73b20.tar.gz
frameworks_av-6f9f029f7fc625bb2a1b448ad30a80a6a6a73b20.tar.bz2
Make sure live streamed http live content does not start playing from the very beginning.
The different bandwidth streams may not all start on the same seqnum, so switching bandwidths may fail lateron if we start playing from the very beginning. Change-Id: I03df8d1f44b3f7b4713d381a3d97847997e3ee59 related-to-bug: 2368598
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r--media/libstagefright/httplive/LiveSource.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/LiveSource.cpp b/media/libstagefright/httplive/LiveSource.cpp
index 39e3e75..f9d27eb 100644
--- a/media/libstagefright/httplive/LiveSource.cpp
+++ b/media/libstagefright/httplive/LiveSource.cpp
@@ -278,7 +278,19 @@ bool LiveSource::switchToNext() {
}
if (mLastFetchTimeUs < 0) {
- mPlaylistIndex = 0;
+ if (isSeekable()) {
+ mPlaylistIndex = 0;
+ } else {
+ // This is live streamed content, the first seqnum in the
+ // various bandwidth' streams may be slightly off, so don't
+ // start at the very first entry.
+ // With a segment duration of 6-10secs, this really only
+ // delays playback up to 30secs compared to real time.
+ mPlaylistIndex = 3;
+ if (mPlaylistIndex >= mPlaylist->size()) {
+ mPlaylistIndex = mPlaylist->size() - 1;
+ }
+ }
} else {
if (nextSequenceNumber < mFirstItemSequenceNumber
|| nextSequenceNumber