Make sure OnChanged() notifications are handled, post construction.

If an instance of AudioRtpReceiver was initialized with a valid media
channel pointer (i.e. SetMediaChannel() was not being called), then
OnChanged() notification would not be handled correctly.

This fixes the issue by making sure the safety flag is marked as
'alive' when [re]starting the media channel.

Bug: webrtc:13854
Fixes: webrtc:13854
Change-Id: Iaa5cfeb4036bfc9dc2efbfa9e1319d508ab151a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256361
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36290}
diff --git a/pc/audio_rtp_receiver.cc b/pc/audio_rtp_receiver.cc
index 3a30672..58f4dfa 100644
--- a/pc/audio_rtp_receiver.cc
+++ b/pc/audio_rtp_receiver.cc
@@ -191,6 +191,11 @@
   if (!media_channel_)
     return;  // Can't restart.
 
+  // Make sure the safety flag is marked as `alive` for cases where the media
+  // channel was provided via the ctor and not an explicit call to
+  // SetMediaChannel.
+  worker_thread_safety_->SetAlive();
+
   if (state != MediaSourceInterface::kInitializing) {
     if (ssrc_ == ssrc)
       return;