diff --git a/pc/audio_rtp_receiver.cc b/pc/audio_rtp_receiver.cc index 4efab24d15..cfaee40480 100644 --- a/pc/audio_rtp_receiver.cc +++ b/pc/audio_rtp_receiver.cc @@ -93,11 +93,14 @@ void AudioRtpReceiver::OnSetVolume(double volume) { RTC_DCHECK_RUN_ON(&signaling_thread_checker_); RTC_DCHECK_GE(volume, 0); RTC_DCHECK_LE(volume, 10); - if (stopped_) - return; + // Update the cached_volume_ even when stopped_, to allow clients to set the + // volume before starting/restarting, eg see crbug.com/1272566. cached_volume_ = volume; + if (stopped_) + return; + // When the track is disabled, the volume of the source, which is the // corresponding WebRtc Voice Engine channel will be 0. So we do not allow // setting the volume to the source when the track is disabled.