summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts
diff options
context:
space:
mode:
authorApurupa Pattapu <apurupa@codeaurora.org>2014-10-14 15:05:50 -0700
committerLajos Molnar <lajos@google.com>2015-01-28 21:52:09 -0800
commit79971c747e62cad50359286f18dee0c4de5829da (patch)
treed0c36872da5d2cfff2a8e198ce2dbc99ec85acbe /media/libstagefright/mpeg2ts
parent9dee2e592e89e90097cbb3b5065cffa768917b56 (diff)
downloadframeworks_av-79971c747e62cad50359286f18dee0c4de5829da.zip
frameworks_av-79971c747e62cad50359286f18dee0c4de5829da.tar.gz
frameworks_av-79971c747e62cad50359286f18dee0c4de5829da.tar.bz2
httplive: Dont resume if we have almost fetched till stop time
- Use the last enqueued instead of last dequeued time in ResumeUntil. - Set duration in access unit meta as timestamp difference between the last two queued access units. Bug: 18821145 Change-Id: If53ddee1d87775905a6d4f11a6219fe66f498450
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r--media/libstagefright/mpeg2ts/AnotherPacketSource.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
index 0354a2d..f266fe7 100644
--- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
+++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp
@@ -221,9 +221,16 @@ void AnotherPacketSource::queueAccessUnit(const sp<ABuffer> &buffer) {
mLatestEnqueuedMeta = buffer->meta()->dup();
} else {
int64_t latestTimeUs = 0;
+ int64_t frameDeltaUs = 0;
CHECK(mLatestEnqueuedMeta->findInt64("timeUs", &latestTimeUs));
if (lastQueuedTimeUs > latestTimeUs) {
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);
}
}
}