Index: media/cast/sender/audio_sender.cc |
diff --git a/media/cast/sender/audio_sender.cc b/media/cast/sender/audio_sender.cc |
index 1dee7bcb876bc0addf52488d14b723c5839f5cb7..13db1005bfea12aac2240e51e09754e2e0084a86 100644 |
--- a/media/cast/sender/audio_sender.cc |
+++ b/media/cast/sender/audio_sender.cc |
@@ -30,8 +30,8 @@ AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment, |
audio_encoder_.reset(new AudioEncoder( |
cast_environment, audio_config.channels, audio_config.rtp_timebase, |
audio_config.max_bitrate, audio_config.codec, |
- base::Bind(&AudioSender::OnEncodedAudioFrame, |
- weak_factory_.GetWeakPtr(), audio_config.max_bitrate))); |
+ base::Bind(&AudioSender::OnEncodedAudioFrame, AsWeakPtr(), |
+ audio_config.max_bitrate))); |
} |
// AudioEncoder provides no operational status changes during normal use. |
@@ -72,6 +72,10 @@ void AudioSender::InsertAudio(std::unique_ptr<AudioBus> audio_bus, |
audio_encoder_->InsertAudio(std::move(audio_bus), recorded_time); |
} |
+base::WeakPtr<AudioSender> AudioSender::AsWeakPtr() { |
+ return weak_factory_.GetWeakPtr(); |
+} |
+ |
int AudioSender::GetNumberOfFramesInEncoder() const { |
// Note: It's possible for a partial frame to be in the encoder, but returning |
// the floor() is good enough for the "design limit" check in FrameSender. |