Index: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp |
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp |
index 10c2e52354652c43602fb7dd5f62b5aeb090598b..10fb1add97279ffc66ea7e544b61d9c079eced15 100644 |
--- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp |
+++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp |
@@ -72,6 +72,11 @@ MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, |
constraints_() { |
component_->Source()->AddObserver(this); |
+ // If the source is already non-live at this point, the observer won't have |
+ // been called. Check the state manually. |
+ if (ready_state_ != component_->Source()->GetReadyState()) |
+ SourceChangedState(); |
Max Morin
2017/06/02 09:56:05
You seem to be calling a virtual method from the c
ossu-chromium
2017/06/02 10:48:00
You're right. I actually only need to add a check
|
+ |
if (component_->Source() && |
component_->Source()->GetType() == MediaStreamSource::kTypeVideo) { |
// ImageCapture::create() only throws if |this| track is not of video type. |