Chromium Code Reviews| Index: remoting/protocol/rtp_video_reader.cc |
| diff --git a/remoting/protocol/rtp_video_reader.cc b/remoting/protocol/rtp_video_reader.cc |
| index 9b979610808f65e158e875749a46f48f4447825b..19bf2fbdc9f239865499b184c5dddd0385b12dea 100644 |
| --- a/remoting/protocol/rtp_video_reader.cc |
| +++ b/remoting/protocol/rtp_video_reader.cc |
| @@ -41,14 +41,15 @@ void RtpVideoReader::Init(protocol::Session* session, |
| session->CreateDatagramChannel( |
| kVideoRtpChannelName, |
| - base::Bind(&RtpVideoReader::OnChannelReady, base::Unretained(this))); |
| + base::Bind(&RtpVideoReader::OnChannelReady, |
| + base::Unretained(this), true)); |
| session->CreateDatagramChannel( |
| kVideoRtcpChannelName, |
| - base::Bind(&RtpVideoReader::OnChannelReady, base::Unretained(this))); |
| + base::Bind(&RtpVideoReader::OnChannelReady, |
| + base::Unretained(this), false)); |
| } |
| -void RtpVideoReader::OnChannelReady(const std::string& name, |
| - net::Socket* socket) { |
| +void RtpVideoReader::OnChannelReady(bool rtp, net::Socket* socket) { |
|
Wez
2011/08/09 23:42:35
Why have an |rtp| bool here, rather than the conta
Sergey Ulanov
2011/08/10 00:00:43
because we also need to initialized |rtp_reader_|
Wez
2011/08/10 00:37:13
Yes, but that could be managed with:
if (socket
|
| if (!socket) { |
| if (!initialized_) { |
| initialized_ = true; |
| @@ -57,16 +58,14 @@ void RtpVideoReader::OnChannelReady(const std::string& name, |
| return; |
| } |
| - if (name == kVideoRtpChannelName) { |
| + if (rtp) { |
| DCHECK(!rtp_channel_.get()); |
| rtp_channel_.reset(socket); |
| rtp_reader_.Init(socket, NewCallback(this, &RtpVideoReader::OnRtpPacket)); |
| - } else if (name == kVideoRtcpChannelName) { |
| + } else { |
| DCHECK(!rtcp_channel_.get()); |
| rtcp_channel_.reset(socket); |
| rtcp_writer_.Init(socket); |
| - } else { |
| - NOTREACHED(); |
| } |
| if (rtp_channel_.get() && rtcp_channel_.get()) { |