Chromium Code Reviews| Index: content/renderer/media/external_media_stream_audio_source.cc |
| diff --git a/content/renderer/media/external_media_stream_audio_source.cc b/content/renderer/media/external_media_stream_audio_source.cc |
| index 7c2977c2907c46249730468bb2f63b81ffbe75a3..01b32ad6b3d46b57271791cb2cd645386f909cf9 100644 |
| --- a/content/renderer/media/external_media_stream_audio_source.cc |
| +++ b/content/renderer/media/external_media_stream_audio_source.cc |
| @@ -40,7 +40,10 @@ bool ExternalMediaStreamAudioSource::EnsureSourceIsStarted() { |
| << GetAudioParameters().AsHumanReadableString() << "}."; |
| source_->Initialize(GetAudioParameters(), this, -1); |
| source_->Start(); |
| - was_started_ = true; |
| + // OnCaptureStarted() is expected to be called synchronously by this |
|
miu
2017/01/11 20:51:11
I don't think it's synchronous. The callback origi
tommi (sloooow) - chröme
2017/01/11 22:40:58
OK, I traced through the code and may have missed
miu
2017/01/12 21:25:37
IIRC, the original implementor added browser tests
|
| + // implementation. If this needs to be changed, the source needs to be started |
| + // outside of EnsureSourceIsStarted since its design is synchronous. |
| + CHECK(was_started_); |
| return true; |
| } |
| @@ -57,6 +60,10 @@ void ExternalMediaStreamAudioSource::EnsureSourceIsStopped() { |
| << GetAudioParameters().AsHumanReadableString() << "}."; |
| } |
| +void ExternalMediaStreamAudioSource::OnCaptureStarted() { |
| + was_started_ = true; |
| +} |
| + |
| void ExternalMediaStreamAudioSource::Capture(const media::AudioBus* audio_bus, |
| int audio_delay_milliseconds, |
| double volume, |