Don't destroy a receive stream's sink before reassigning it.

Bug: chromium:820901
Change-Id: If1f2ea82172154c8645baf5fbbba3acf17ddc19b
Reviewed-on: https://webrtc-review.googlesource.com/62346
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22477}
This commit is contained in:
Oskar Sundbom 2018-03-16 13:56:27 +01:00 committed by Commit Bot
parent 3bb1194fff
commit 4ccc1c4bb6

View File

@ -1181,8 +1181,10 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
void SetRawAudioSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
// Need to update the stream's sink first; once raw_audio_sink_ is
// reassigned, whatever was in there before is destroyed.
stream_->SetSink(sink.get());
raw_audio_sink_ = std::move(sink);
stream_->SetSink(raw_audio_sink_.get());
}
void SetOutputVolume(double volume) {