Initialize payload-type frequency in channel.cc.
Uninitialized values triggered divide-by-zero crashes in voe_auto_test. BUG= R=stefan@webrtc.org, xians@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1780004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4319 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
28e2075280
commit
08933a5dfb
@ -304,6 +304,7 @@ class RTPPayloadAudioStrategy : public RTPPayloadStrategy {
|
|||||||
ModuleRTPUtility::Payload* payload = new ModuleRTPUtility::Payload;
|
ModuleRTPUtility::Payload* payload = new ModuleRTPUtility::Payload;
|
||||||
payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
|
payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
|
||||||
strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
|
strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
|
||||||
|
assert(frequency >= 1000);
|
||||||
payload->typeSpecific.Audio.frequency = frequency;
|
payload->typeSpecific.Audio.frequency = frequency;
|
||||||
payload->typeSpecific.Audio.channels = channels;
|
payload->typeSpecific.Audio.channels = channels;
|
||||||
payload->typeSpecific.Audio.rate = rate;
|
payload->typeSpecific.Audio.rate = rate;
|
||||||
|
@ -334,6 +334,8 @@ bool RtpReceiverImpl::RetransmitOfOldPacket(const RTPHeader& header,
|
|||||||
|
|
||||||
CriticalSectionScoped cs(critical_section_rtp_receiver_);
|
CriticalSectionScoped cs(critical_section_rtp_receiver_);
|
||||||
uint32_t frequency_khz = header.payload_type_frequency / 1000;
|
uint32_t frequency_khz = header.payload_type_frequency / 1000;
|
||||||
|
assert(frequency_khz > 0);
|
||||||
|
|
||||||
int64_t time_diff_ms = clock_->TimeInMilliseconds() -
|
int64_t time_diff_ms = clock_->TimeInMilliseconds() -
|
||||||
last_receive_time_;
|
last_receive_time_;
|
||||||
|
|
||||||
|
@ -2182,6 +2182,8 @@ int32_t Channel::ReceivedRTPPacket(const int8_t* data, int32_t length) {
|
|||||||
"IncomingPacket invalid RTP header");
|
"IncomingPacket invalid RTP header");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
header.payload_type_frequency =
|
||||||
|
rtp_payload_registry_->GetPayloadTypeFrequency(header.payloadType);
|
||||||
bool retransmitted = IsPacketRetransmitted(header);
|
bool retransmitted = IsPacketRetransmitted(header);
|
||||||
bool in_order = rtp_receiver_->InOrderPacket(header.sequenceNumber);
|
bool in_order = rtp_receiver_->InOrderPacket(header.sequenceNumber);
|
||||||
rtp_receive_statistics_->IncomingPacket(header, static_cast<uint16_t>(length),
|
rtp_receive_statistics_->IncomingPacket(header, static_cast<uint16_t>(length),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user