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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 23618031: [Android WebView] Clean up global GL resource pt.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 7 years, 3 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
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 8eda65f107f7c946b7038346d0e2128b0192464e..881fe477307cdd44f5987843b427749951013134 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -127,7 +127,7 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid(
#endif
if (stream_texture_factory_) {
stream_texture_proxy_.reset(stream_texture_factory_->CreateProxy());
- if (needs_establish_peer_) {
+ if (needs_establish_peer_ && stream_texture_proxy_) {
stream_id_ = stream_texture_factory_->CreateStreamTexture(
kGLTextureExternalOES,
&texture_id_,
@@ -860,6 +860,9 @@ void WebMediaPlayerAndroid::PutCurrentFrame(
}
void WebMediaPlayerAndroid::EstablishSurfaceTexturePeer() {
+ if (!stream_texture_proxy_)
+ return;
+
if (media_source_delegate_ && stream_texture_factory_) {
// MediaCodec will release the old surface when it goes away, we need to
// recreate a new one each time this is called.

Powered by Google App Engine
This is Rietveld 408576698