Index: talk/app/webrtc/peerconnection.cc |
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc |
index f1ff4e6d36ee5d82ceedca1124ad3dbfa89b078b..459c74cbbe0261239ff42ba357fe037e2ad30c46 100644 |
--- a/talk/app/webrtc/peerconnection.cc |
+++ b/talk/app/webrtc/peerconnection.cc |
@@ -39,6 +39,7 @@ |
#include "talk/app/webrtc/mediastreamproxy.h" |
#include "talk/app/webrtc/mediastreamtrackproxy.h" |
#include "talk/app/webrtc/remoteaudiosource.h" |
+#include "talk/app/webrtc/remoteaudiotrack.h" |
#include "talk/app/webrtc/remotevideocapturer.h" |
#include "talk/app/webrtc/rtpreceiver.h" |
#include "talk/app/webrtc/rtpsender.h" |
@@ -449,10 +450,12 @@ class RemoteMediaStreamFactory { |
MediaStream::Create(stream_label)); |
} |
- AudioTrackInterface* AddAudioTrack(webrtc::MediaStreamInterface* stream, |
+ AudioTrackInterface* AddAudioTrack(uint32_t ssrc, |
+ AudioProviderInterface* provider, |
+ webrtc::MediaStreamInterface* stream, |
const std::string& track_id) { |
- return AddTrack<AudioTrackInterface, AudioTrack, AudioTrackProxy>( |
- stream, track_id, RemoteAudioSource::Create().get()); |
+ return AddTrack<AudioTrackInterface, RemoteAudioTrack, AudioTrackProxy>( |
+ stream, track_id, RemoteAudioSource::Create(ssrc, provider)); |
} |
VideoTrackInterface* AddVideoTrack(webrtc::MediaStreamInterface* stream, |
@@ -468,7 +471,7 @@ class RemoteMediaStreamFactory { |
template <typename TI, typename T, typename TP, typename S> |
TI* AddTrack(MediaStreamInterface* stream, |
const std::string& track_id, |
- S* source) { |
+ const S& source) { |
rtc::scoped_refptr<TI> track( |
TP::Create(signaling_thread_, T::Create(track_id, source))); |
track->set_state(webrtc::MediaStreamTrackInterface::kLive); |
@@ -1590,8 +1593,8 @@ void PeerConnection::OnRemoteTrackSeen(const std::string& stream_label, |
MediaStreamInterface* stream = remote_streams_->find(stream_label); |
if (media_type == cricket::MEDIA_TYPE_AUDIO) { |
- AudioTrackInterface* audio_track = |
- remote_stream_factory_->AddAudioTrack(stream, track_id); |
+ AudioTrackInterface* audio_track = remote_stream_factory_->AddAudioTrack( |
+ ssrc, session_.get(), stream, track_id); |
CreateAudioReceiver(stream, audio_track, ssrc); |
} else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
VideoTrackInterface* video_track = |