Fixed issue for rtp extension.

BUG=

Review URL: https://webrtc-codereview.appspot.com/731012

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2629 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-08-17 14:44:21 +00:00
parent 154dbbefa2
commit 42a4891699

View File

@ -679,15 +679,33 @@ bool ViEChannel::EnableRemb(bool enable) {
}
int ViEChannel::SetSendTimestampOffsetStatus(bool enable, int id) {
int error = 0;
if (enable) {
// Enable the extension, but disable possible old id to avoid errors.
send_timestamp_extension_id_ = id;
return rtp_rtcp_->RegisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset, id);
} else {
send_timestamp_extension_id_ = kInvalidRtpExtensionId;
return rtp_rtcp_->DeregisterSendRtpHeaderExtension(
rtp_rtcp_->DeregisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset);
error = rtp_rtcp_->RegisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset, id);
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
it != simulcast_rtp_rtcp_.end(); it++) {
(*it)->DeregisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset);
error |= (*it)->RegisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset, id);
}
} else {
// Disable the extension.
send_timestamp_extension_id_ = kInvalidRtpExtensionId;
rtp_rtcp_->DeregisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset);
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
it != simulcast_rtp_rtcp_.end(); it++) {
(*it)->DeregisterSendRtpHeaderExtension(
kRtpExtensionTransmissionTimeOffset);
}
}
return error;
}
int ViEChannel::SetReceiveTimestampOffsetStatus(bool enable, int id) {