From 39f5874c4040bec6fdbf0c0912daffcb10010df8 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Thu, 28 Aug 2014 15:18:53 -0700 Subject: [PATCH] PlaylistFetcher: add lower bound check when starting live streams Avoid false 'missed the boat' alarms that cause us to queue a bogus discontinuity before even starting. Bug: 17303166 Change-Id: I5003934fc695f30db2df9a0803b8fe960d77a458 --- media/libstagefright/httplive/PlaylistFetcher.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 80cb2d0946..4d5d79ebc1 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -754,6 +754,9 @@ void PlaylistFetcher::onDownloadNext() { if (!mPlaylist->isComplete() && !mPlaylist->isEvent()) { // If this is a live session, start 3 segments from the end on connect mSeqNumber = lastSeqNumberInPlaylist - 3; + if (mSeqNumber < firstSeqNumberInPlaylist) { + mSeqNumber = firstSeqNumberInPlaylist; + } } else { mSeqNumber = getSeqNumberForTime(mStartTimeUs); mStartTimeUs -= getSegmentStartTimeUs(mSeqNumber); -- 2.11.0