summaryrefslogtreecommitdiff
path: root/media/jni/android_media_MediaCodec.cpp
diff options
context:
space:
mode:
authorRay Essick <essick@google.com>2019-09-18 14:04:28 -0700
committerRay Essick <essick@google.com>2019-09-18 14:04:28 -0700
commit758c7385e7a3bd6dfa85da5a5c77c454e99f9541 (patch)
tree85bd19c113bbb866cd83d8075d615cf8e2bf69aa /media/jni/android_media_MediaCodec.cpp
parentf2bacf0eaecdd03be90ef744069bdc79dc353e06 (diff)
pass updated getMetrics() values back to caller
conversion from C++ to C routines lost the fact that a parameter was by reference and broke back propagation of the updated value. This passes the update back to caller. Bug: 140763926 Test: CTS android.media.cts.MediaCodecTest#testDecodeAfterFlush
Diffstat (limited to 'media/jni/android_media_MediaCodec.cpp')
-rw-r--r--media/jni/android_media_MediaCodec.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index cbc820b6fde0..05aaa82f8ac8 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -745,6 +745,8 @@ status_t JMediaCodec::getCodecInfo(JNIEnv *env, jobject *codecInfoObject) const
status_t JMediaCodec::getMetrics(JNIEnv *, MediaAnalyticsItem * &reply) const {
mediametrics_handle_t reply2 = MediaAnalyticsItem::convert(reply);
status_t status = mCodec->getMetrics(reply2);
+ // getMetrics() updates reply2, pass the converted update along to our caller.
+ reply = MediaAnalyticsItem::convert(reply2);
return status;
}