Index: webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java |
diff --git a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java |
index 51e593e655f9b97a0833ed2191219a9783a942d3..17fc7ab8e86a90786ba919487cc1d0e4df1cbfa8 100644 |
--- a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java |
+++ b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java |
@@ -171,8 +171,13 @@ public class PeerConnectionFactory { |
*/ |
public void setVideoHwAccelerationOptions(EglBase.Context localEglContext, |
EglBase.Context remoteEglContext) { |
- if (localEglbase != null || remoteEglbase != null) { |
- throw new IllegalStateException("Egl context already set."); |
+ if (localEglbase != null) { |
+ Logging.w(TAG, "Egl context already set."); |
+ localEglbase.release(); |
+ } |
+ if (remoteEglbase != null) { |
+ Logging.w(TAG, "Egl context already set."); |
+ remoteEglbase.release(); |
} |
localEglbase = EglBase.create(localEglContext); |
remoteEglbase = EglBase.create(remoteEglContext); |