Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: talk/app/webrtc/java/jni/androidmediadecoder_jni.cc

Issue 1394303005: Android MediaCodecVideoDecoder: Limit max pending frames to number of input buffers (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
diff --git a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
index 418afe26ca66239b81dce3f288b31332b51e3e43..ed5ba0b478edd0df334db0e1eca929e101312415 100644
--- a/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
+++ b/talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
@@ -26,6 +26,7 @@
*
*/
+#include <algorithm>
#include <vector>
#include "talk/app/webrtc/java/jni/androidmediadecoder_jni.h"
@@ -340,6 +341,8 @@ int32_t MediaCodecVideoDecoder::InitDecodeOnCodecThread() {
jobjectArray input_buffers = (jobjectArray)GetObjectField(
jni, *j_media_codec_video_decoder_, j_input_buffers_field_);
size_t num_input_buffers = jni->GetArrayLength(input_buffers);
+ max_pending_frames_ =
+ std::min(max_pending_frames_, static_cast<uint32_t>(num_input_buffers));
input_buffers_.resize(num_input_buffers);
for (size_t i = 0; i < num_input_buffers; ++i) {
input_buffers_[i] =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698