Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63d674c3 authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am ca808ae2: Merge "If the stream for the new bandwidth doesn\'t have the...

am ca808ae2: Merge "If the stream for the new bandwidth doesn\'t have the segment we\'re looking for..." into honeycomb

* commit 'ca808ae2':
  If the stream for the new bandwidth doesn't have the segment we're looking for...
parents d01b9be9 ca808ae2
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -340,6 +340,7 @@ size_t LiveSession::getBandwidthIndex() {
void LiveSession::onDownloadNext() {
    size_t bandwidthIndex = getBandwidthIndex();

rinse_repeat:
    int64_t nowUs = ALooper::GetNowUs();

    if (mLastPlaylistFetchTimeUs < 0
@@ -437,6 +438,18 @@ void LiveSession::onDownloadNext() {

    if (mSeqNumber < firstSeqNumberInPlaylist
            || mSeqNumber > lastSeqNumberInPlaylist) {
        if (mSeqNumber < firstSeqNumberInPlaylist
                && mPrevBandwidthIndex != (ssize_t)bandwidthIndex) {
            // Go back to the previous bandwidth.

            LOGI("new bandwidth does not have the sequence number "
                 "we're looking for, switching back to previous bandwidth");

            mLastPlaylistFetchTimeUs = -1;
            bandwidthIndex = mPrevBandwidthIndex;
            goto rinse_repeat;
        }

        if (!mPlaylist->isComplete()
                && mSeqNumber > lastSeqNumberInPlaylist
                && mNumRetries < kMaxNumRetries) {