summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/mpeg2ts
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-01-29 18:36:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-29 18:36:48 +0000
commit2af6048454f6f6aa9a4d7ccf5fccdb3f8d47ac27 (patch)
tree0e04966b0c7bb58aa77a8017b3bd059e5bd38c64 /media/libstagefright/mpeg2ts
parentde3f8a1ed744eb89ae59b3fde9774a52802d2a4c (diff)
parent46246e5b1725a8a1868dbd9f37fffe33c19672fc (diff)
downloadframeworks_av-2af6048454f6f6aa9a4d7ccf5fccdb3f8d47ac27.zip
frameworks_av-2af6048454f6f6aa9a4d7ccf5fccdb3f8d47ac27.tar.gz
frameworks_av-2af6048454f6f6aa9a4d7ccf5fccdb3f8d47ac27.tar.bz2
am 46246e5b: resolved conflicts for merge of 59d1d010 to lmp-mr1-dev-plus-aosp
* commit '46246e5b1725a8a1868dbd9f37fffe33c19672fc': httplive: Dont resume if we have almost fetched till stop time
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);
}
}
}