summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-05-08 17:39:40 -0700
committerRobert Shih <robertshih@google.com>2015-05-11 11:18:52 -0700
commitaabbdc7401ae24a4199f12a283985deb648673c0 (patch)
tree947b5414363dfd110f30728b61b38ad3b927dc0f /media/libstagefright/httplive
parentd02ac2c7286ca7190ddaf861095cd0b16e28da1e (diff)
downloadframeworks_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/httplive')
-rw-r--r--media/libstagefright/httplive/PlaylistFetcher.cpp10
1 files changed, 10 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.