[InsertableStreams] Clear callback to audio receive channel in delegate.

Reset the frame transformer delegate's callback to
ChannelReceive::OnReceivedPayloadData when the channel is destroyed, to
prevent future callbacks from the delegate.

Bug: chromium:870644
Change-Id: Iaa2c1b7b26dc38709d3fe64a180ccc6a60a1ec9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173751
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31121}
This commit is contained in:
Marina Ciocea 2020-04-22 11:57:17 +02:00 committed by Commit Bot
parent 1120f7d895
commit f4ee036871

View File

@ -520,6 +520,10 @@ ChannelReceive::ChannelReceive(
ChannelReceive::~ChannelReceive() {
RTC_DCHECK(construction_thread_.IsCurrent());
// Resets the delegate's callback to ChannelReceive::OnReceivedPayloadData.
if (frame_transformer_delegate_)
frame_transformer_delegate_->Reset();
StopPlayout();
if (_moduleProcessThreadPtr)