| Index: webrtc/api/java/jni/androidmediadecoder_jni.cc
|
| diff --git a/webrtc/api/java/jni/androidmediadecoder_jni.cc b/webrtc/api/java/jni/androidmediadecoder_jni.cc
|
| index f7966cc44a86c9359d89621c9788b546d9244f27..7c303e8fc311eeefb0a8bb4610047230e74cba42 100644
|
| --- a/webrtc/api/java/jni/androidmediadecoder_jni.cc
|
| +++ b/webrtc/api/java/jni/androidmediadecoder_jni.cc
|
| @@ -896,7 +896,10 @@ MediaCodecVideoDecoderFactory::~MediaCodecVideoDecoderFactory() {
|
| void MediaCodecVideoDecoderFactory::SetEGLContext(
|
| JNIEnv* jni, jobject egl_context) {
|
| ALOGD << "MediaCodecVideoDecoderFactory::SetEGLContext";
|
| - RTC_DCHECK(!egl_context_);
|
| + if (egl_context_) {
|
| + jni->DeleteGlobalRef(egl_context_);
|
| + egl_context_ = nullptr;
|
| + }
|
| egl_context_ = jni->NewGlobalRef(egl_context);
|
| if (CheckException(jni)) {
|
| ALOGE << "error calling NewGlobalRef for EGL Context.";
|
|
|