Index: talk/app/webrtc/peerconnection.cc |
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc |
index e7b33c43acdbd917ad549aac93df2611fd818475..1e225334705698ca07f67cc73e943ee48e08d354 100644 |
--- a/talk/app/webrtc/peerconnection.cc |
+++ b/talk/app/webrtc/peerconnection.cc |
@@ -1029,7 +1029,13 @@ void PeerConnection::SetRemoteDescription( |
const cricket::AudioContentDescription* desc = |
static_cast<const cricket::AudioContentDescription*>( |
audio_content->description); |
- UpdateRemoteStreamsList(desc->streams(), desc->type(), new_streams); |
+ // If the direction is "recvonly" or "inactive", treat the description |
+ // as containing no streams. |
+ // See: https://code.google.com/p/webrtc/issues/detail?id=5054 |
+ UpdateRemoteStreamsList(MediaContentDirectionHasSend(desc->direction()) |
+ ? desc->streams() |
+ : std::vector<cricket::StreamParams>(), |
pthatcher1
2015/10/15 05:46:49
Can you put this logic in a method called "GetActi
Taylor Brandstetter
2015/10/15 17:32:24
Done.
|
+ desc->type(), new_streams); |
remote_info_.default_audio_track_needed = |
MediaContentDirectionHasSend(desc->direction()) && |
desc->streams().empty(); |
@@ -1042,7 +1048,10 @@ void PeerConnection::SetRemoteDescription( |
const cricket::VideoContentDescription* desc = |
static_cast<const cricket::VideoContentDescription*>( |
video_content->description); |
- UpdateRemoteStreamsList(desc->streams(), desc->type(), new_streams); |
+ UpdateRemoteStreamsList(MediaContentDirectionHasSend(desc->direction()) |
+ ? desc->streams() |
+ : std::vector<cricket::StreamParams>(), |
+ desc->type(), new_streams); |
remote_info_.default_video_track_needed = |
MediaContentDirectionHasSend(desc->direction()) && |
desc->streams().empty(); |
@@ -1051,12 +1060,15 @@ void PeerConnection::SetRemoteDescription( |
// Update the DataChannels with the information from the remote peer. |
const cricket::ContentInfo* data_content = GetFirstDataContent(remote_desc); |
if (data_content) { |
- const cricket::DataContentDescription* data_desc = |
+ const cricket::DataContentDescription* desc = |
static_cast<const cricket::DataContentDescription*>( |
data_content->description); |
- if (rtc::starts_with(data_desc->protocol().data(), |
+ if (rtc::starts_with(desc->protocol().data(), |
cricket::kMediaProtocolRtpPrefix)) { |
- UpdateRemoteRtpDataChannels(data_desc->streams()); |
+ UpdateRemoteRtpDataChannels( |
+ MediaContentDirectionHasSend(desc->direction()) |
+ ? desc->streams() |
+ : std::vector<cricket::StreamParams>()); |
} |
} |