diff options
| author | 2010-11-16 11:13:43 -0800 | |
|---|---|---|
| committer | 2010-11-16 11:13:43 -0800 | |
| commit | 7a218d7a3ad7f8aab1f28f8b72154204e16d73ec (patch) | |
| tree | 3f561940a6d2cd41909883600fcc3a55b04904c6 | |
| parent | 3a57fb9e9c4f205ca6bd4f036b3080f92588d16d (diff) | |
| parent | 8c7cb61cff38580b9f38da9f8b70305afe83b3ed (diff) | |
Merge "Make sure live streamed http live content does not start playing from the very beginning."
| -rw-r--r-- | media/libstagefright/httplive/LiveSource.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/LiveSource.cpp b/media/libstagefright/httplive/LiveSource.cpp index 39e3e75cd43d..f9d27ebc0e0d 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 |