Index: talk/media/webrtc/webrtcvoiceengine.cc |
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc |
index a69c824fdf738af39380ce6195bd66a4af635a1c..9eee2af20219d710bfad79104c047ad905f33c76 100644 |
--- a/talk/media/webrtc/webrtcvoiceengine.cc |
+++ b/talk/media/webrtc/webrtcvoiceengine.cc |
@@ -1244,10 +1244,9 @@ |
return config_.voe_channel_id; |
} |
- void SetRawAudioSink( |
- const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink) { |
+ void SetRawAudioSink(rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
- stream_->SetSink(sink); |
+ stream_->SetSink(std::move(sink)); |
} |
private: |
@@ -2187,7 +2186,6 @@ |
} |
default_recv_ssrc_ = ssrc; |
SetOutputVolume(default_recv_ssrc_, default_recv_volume_); |
- SetRawAudioSink(default_recv_ssrc_, default_sink_); |
} |
// Forward packet to Call. If the SSRC is unknown we'll return after this. |
@@ -2414,22 +2412,15 @@ |
void WebRtcVoiceMediaChannel::SetRawAudioSink( |
uint32_t ssrc, |
- const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink) { |
+ rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::SetRawAudioSink"; |
- if (ssrc == 0) { |
- default_sink_ = sink; |
- if (default_recv_ssrc_ == -1) { |
- return; |
- } |
- ssrc = static_cast<uint32_t>(default_recv_ssrc_); |
- } |
const auto it = recv_streams_.find(ssrc); |
if (it == recv_streams_.end()) { |
LOG(LS_WARNING) << "SetRawAudioSink: no recv stream" << ssrc; |
return; |
} |
- it->second->SetRawAudioSink(sink); |
+ it->second->SetRawAudioSink(std::move(sink)); |
} |
int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) { |