diff options
author | Robert Shih <robertshih@google.com> | 2015-05-08 17:39:40 -0700 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2015-05-11 11:18:52 -0700 |
commit | aabbdc7401ae24a4199f12a283985deb648673c0 (patch) | |
tree | 947b5414363dfd110f30728b61b38ad3b927dc0f /media/libstagefright | |
parent | d02ac2c7286ca7190ddaf861095cd0b16e28da1e (diff) | |
download | frameworks_av-aabbdc7401ae24a4199f12a283985deb648673c0.zip frameworks_av-aabbdc7401ae24a4199f12a283985deb648673c0.tar.gz frameworks_av-aabbdc7401ae24a4199f12a283985deb648673c0.tar.bz2 |
HLS: invoke signalEOS on ATSParser to flush out final samples
Also clear EOS status when we reset ATSParser.
Bug: 20959760
Change-Id: I730234acf3cdbee08affe0f28b7e8759e11059cb
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 10 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/ATSParser.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/ESQueue.cpp | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 53087b6..b8cc5d1 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -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. diff --git a/media/libstagefright/mpeg2ts/ATSParser.cpp b/media/libstagefright/mpeg2ts/ATSParser.cpp index 0d071b2..e8b2219 100644 --- a/media/libstagefright/mpeg2ts/ATSParser.cpp +++ b/media/libstagefright/mpeg2ts/ATSParser.cpp @@ -746,6 +746,7 @@ void ATSParser::Stream::signalDiscontinuity( } mPayloadStarted = false; + mEOSReached = false; mBuffer->setRange(0, 0); bool clearFormat = false; diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp index 7b5b46a..baf3b15 100644 --- a/media/libstagefright/mpeg2ts/ESQueue.cpp +++ b/media/libstagefright/mpeg2ts/ESQueue.cpp @@ -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, |