Index: content/renderer/media/android/stream_texture_factory_synchronous_impl.cc |
diff --git a/content/renderer/media/android/stream_texture_factory_synchronous_impl.cc b/content/renderer/media/android/stream_texture_factory_synchronous_impl.cc |
index e46395d0cd1de7a1a380dbe88147be471fba60a6..093012a150750aef59e9cc591d0dff6550b99ce6 100644 |
--- a/content/renderer/media/android/stream_texture_factory_synchronous_impl.cc |
+++ b/content/renderer/media/android/stream_texture_factory_synchronous_impl.cc |
@@ -166,13 +166,14 @@ StreamTextureFactorySynchronousImpl::StreamTextureFactorySynchronousImpl( |
StreamTextureFactorySynchronousImpl::~StreamTextureFactorySynchronousImpl() {} |
StreamTextureProxy* StreamTextureFactorySynchronousImpl::CreateProxy() { |
- if (!context_provider_) |
+ bool had_proxy = !!context_provider_; |
+ if (!had_proxy) |
context_provider_ = create_context_provider_callback_.Run(); |
if (!context_provider_) |
return NULL; |
- if (observer_) |
+ if (observer_ && !had_proxy) |
context_provider_->AddObserver(observer_); |
return new StreamTextureProxyImpl(context_provider_); |
} |