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

Unified Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp

Issue 2919793002: Detect AudioInputStream muting and propagate to MediaStreamAudioSource. (Closed)
Patch Set: Created 3 years, 7 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
« media/audio/audio_input_device.cc ('K') | « media/base/audio_capturer_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« media/audio/audio_input_device.cc ('K') | « media/base/audio_capturer_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698