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

Commit 7dbbc7ec authored by Robert Shih's avatar Robert Shih Committed by Android Git Automerger
Browse files

am a291dabc: am 6fbcf633: Merge "httplive: Set start time and segment start...

am a291dabc: am 6fbcf633: Merge "httplive: Set start time and segment start time in conjunction." into lmp-mr1-dev

* commit 'a291dabc':
  httplive: Set start time and segment start time in conjunction.
parents 3b5d1195 a291dabc
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1508,14 +1508,15 @@ void LiveSession::onChangeConfiguration3(const sp<AMessage> &msg) {

                    if (meta != NULL && !meta->findInt32("discontinuity", &type)) {
                        int64_t tmpUs;
                        int64_t tmpSegmentUs;

                        CHECK(meta->findInt64("timeUs", &tmpUs));
                        if (startTimeUs < 0 || tmpUs < startTimeUs) {
                        CHECK(meta->findInt64("segmentStartTimeUs", &tmpSegmentUs));
                        if (startTimeUs < 0 || tmpSegmentUs < segmentStartTimeUs) {
                            startTimeUs = tmpUs;
                            segmentStartTimeUs = tmpSegmentUs;
                        } else if (tmpSegmentUs == segmentStartTimeUs && tmpUs < startTimeUs) {
                            startTimeUs = tmpUs;
                        }

                        CHECK(meta->findInt64("segmentStartTimeUs", &tmpUs));
                        if (segmentStartTimeUs < 0 || tmpUs < segmentStartTimeUs) {
                            segmentStartTimeUs = tmpUs;
                        }

                        int32_t seq;
+7 −0
Original line number Diff line number Diff line
@@ -757,6 +757,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);
            }
@@ -765,6 +768,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