diff options
author | Robert Shih <robertshih@google.com> | 2014-12-22 11:46:50 -0800 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2014-12-22 11:50:26 -0800 |
commit | f580806d893c4631f5324ff0af5c2db68a40ef42 (patch) | |
tree | bcb818e65e7702333bfb70103b63cf19ec90455f /media/libstagefright/mpeg2ts | |
parent | 5886252a7b08fb5c5d8829443e56a63956986148 (diff) | |
download | frameworks_av-f580806d893c4631f5324ff0af5c2db68a40ef42.zip frameworks_av-f580806d893c4631f5324ff0af5c2db68a40ef42.tar.gz frameworks_av-f580806d893c4631f5324ff0af5c2db68a40ef42.tar.bz2 |
HLS: QCom enhancements
This commit consists of:
http://go/pag/c/188753 Add NULL check for empty playlist
http://go/pag/c/188754 Fix deadlock for low duration clips
http://go/pag/c/188757 Create a copy of last enqueued metadata
http://go/pag/c/188755 Propagate target duration to LiveSession
http://go/pag/c/188762 Decouple block size from bandwidth estimate
http://go/pag/c/188756 Reduce memcpy calls for chunked content
http://go/pag/c/188758 Dont resume if we have almost fetched till stop time
Bug: 18821145
Change-Id: I7fd650999c6c50bbadffd65adee9020e669dfe62
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r-- | media/libstagefright/mpeg2ts/AnotherPacketSource.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp index c579d4c..f266fe7 100644 --- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp @@ -218,12 +218,19 @@ void AnotherPacketSource::queueAccessUnit(const sp<ABuffer> &buffer) { } if (mLatestEnqueuedMeta == NULL) { - mLatestEnqueuedMeta = buffer->meta(); + mLatestEnqueuedMeta = buffer->meta()->dup(); } else { int64_t latestTimeUs = 0; + int64_t frameDeltaUs = 0; CHECK(mLatestEnqueuedMeta->findInt64("timeUs", &latestTimeUs)); if (lastQueuedTimeUs > latestTimeUs) { - mLatestEnqueuedMeta = buffer->meta(); + mLatestEnqueuedMeta = buffer->meta()->dup(); + frameDeltaUs = lastQueuedTimeUs - latestTimeUs; + mLatestEnqueuedMeta->setInt64("durationUs", frameDeltaUs); + } else if (!mLatestEnqueuedMeta->findInt64("durationUs", &frameDeltaUs)) { + // For B frames + frameDeltaUs = latestTimeUs - lastQueuedTimeUs; + mLatestEnqueuedMeta->setInt64("durationUs", frameDeltaUs); } } } |