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

Commit a540058e authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "HLS: invoke signalEOS on ATSParser to flush out final samples" into mnc-dev

parents 804a77d1 aabbdc74
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1082,6 +1082,16 @@ bool PlaylistFetcher::initDownloadState(
                     mSeqNumber, firstSeqNumberInPlaylist,
                      firstSeqNumberInPlaylist + (int32_t)mPlaylist->size() - 1);

                if (mTSParser != NULL) {
                    mTSParser->signalEOS(ERROR_END_OF_STREAM);
                    // Use an empty buffer; we don't have any new data, just want to extract
                    // potential new access units after flush.  Reset mSeqNumber to
                    // lastSeqNumberInPlaylist such that we set the correct access unit
                    // properties in extractAndQueueAccessUnitsFromTs.
                    sp<ABuffer> buffer = new ABuffer(0);
                    mSeqNumber = lastSeqNumberInPlaylist;
                    extractAndQueueAccessUnitsFromTs(buffer);
                }
                notifyError(ERROR_END_OF_STREAM);
            } else {
                // It's possible that we were never able to download the playlist.
+1 −0
Original line number Diff line number Diff line
@@ -746,6 +746,7 @@ void ATSParser::Stream::signalDiscontinuity(
    }

    mPayloadStarted = false;
    mEOSReached = false;
    mBuffer->setRange(0, 0);

    bool clearFormat = false;
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ void ElementaryStreamQueue::clear(bool clearFormat) {
    if (clearFormat) {
        mFormat.clear();
    }

    mEOSReached = false;
}

// Parse AC3 header assuming the current ptr is start position of syncframe,