summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-06-12 14:37:49 -0700
committerLajos Molnar <lajos@google.com>2015-06-12 15:34:56 -0700
commitc8edf5af010ac24a99b302a18e7b84e8b4b2b783 (patch)
tree9bc6820b899c3fe7e91c7a2e8905d68a411461b5 /media/libstagefright/MediaCodec.cpp
parent652bc0197341337bb07fc4f87f168167fb3f47dc (diff)
downloadframeworks_av-c8edf5af010ac24a99b302a18e7b84e8b4b2b783.zip
frameworks_av-c8edf5af010ac24a99b302a18e7b84e8b4b2b783.tar.gz
frameworks_av-c8edf5af010ac24a99b302a18e7b84e8b4b2b783.tar.bz2
stagefright: use media timestamp for default render timestamp
Bug: 21814308 Change-Id: I897bc4878c0b3a758d630e9c117b746ef7e55146
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 7ee84a8..e5b7202 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -2452,18 +2452,12 @@ status_t MediaCodec::onReleaseOutputBuffer(const sp<AMessage> &msg) {
info->mData->meta()->findInt64("timeUs", &mediaTimeUs);
int64_t renderTimeNs = 0;
- if (msg->findInt64("timestampNs", &renderTimeNs)) {
- info->mNotify->setInt64("timestampNs", renderTimeNs);
- } else {
- // TODO: it seems like we should use the timestamp
- // in the (media)buffer as it potentially came from
- // an input surface, but we did not propagate it prior to
- // API 20. Perhaps check for target SDK version.
-#if 0
- ALOGV("using buffer PTS of %" PRId64, timestampNs);
+ if (!msg->findInt64("timestampNs", &renderTimeNs)) {
+ // use media timestamp if client did not request a specific render timestamp
+ ALOGV("using buffer PTS of %lld", (long long)mediaTimeUs);
renderTimeNs = mediaTimeUs * 1000;
-#endif
}
+ info->mNotify->setInt64("timestampNs", renderTimeNs);
if (mSoftRenderer != NULL) {
std::list<FrameRenderTracker::Info> doneFrames = mSoftRenderer->render(