Better error treatment in NetEqImpl::InsertPacketInternal()
BUG=webrtc:1364 R=turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1844004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4493 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -98,7 +98,8 @@ class NetEq {
|
|||||||
kDecodedTooMuch,
|
kDecodedTooMuch,
|
||||||
kFrameSplitError,
|
kFrameSplitError,
|
||||||
kRedundancySplitError,
|
kRedundancySplitError,
|
||||||
kPacketBufferCorruption
|
kPacketBufferCorruption,
|
||||||
|
kOversizePacket
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int kMaxNumPacketsInBuffer = 240; // TODO(hlundin): Remove.
|
static const int kMaxNumPacketsInBuffer = 240; // TODO(hlundin): Remove.
|
||||||
|
@@ -508,11 +508,13 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
|
|||||||
// Reset DSP timestamp etc. if packet buffer flushed.
|
// Reset DSP timestamp etc. if packet buffer flushed.
|
||||||
new_codec_ = true;
|
new_codec_ = true;
|
||||||
LOG_F(LS_WARNING) << "Packet buffer flushed";
|
LOG_F(LS_WARNING) << "Packet buffer flushed";
|
||||||
|
} else if (ret == PacketBuffer::kOversizePacket) {
|
||||||
|
LOG_F(LS_WARNING) << "Packet larger than packet buffer";
|
||||||
|
return kOversizePacket;
|
||||||
} else if (ret != PacketBuffer::kOK) {
|
} else if (ret != PacketBuffer::kOK) {
|
||||||
LOG_FERR1(LS_WARNING, InsertPacketList, packet_list.size());
|
LOG_FERR1(LS_WARNING, InsertPacketList, packet_list.size());
|
||||||
PacketBuffer::DeleteAllPackets(&packet_list);
|
PacketBuffer::DeleteAllPackets(&packet_list);
|
||||||
assert(false);
|
return kOtherError;
|
||||||
// TODO(hlundin): Take care of error codes.
|
|
||||||
}
|
}
|
||||||
if (current_rtp_payload_type_ != 0xFF) {
|
if (current_rtp_payload_type_ != 0xFF) {
|
||||||
const DecoderDatabase::DecoderInfo* dec_info =
|
const DecoderDatabase::DecoderInfo* dec_info =
|
||||||
|
@@ -658,6 +658,18 @@ TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(UnknownPayloadType)) {
|
|||||||
EXPECT_EQ(NetEq::kUnknownRtpPayloadType, neteq_->LastError());
|
EXPECT_EQ(NetEq::kUnknownRtpPayloadType, neteq_->LastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(OversizePacket)) {
|
||||||
|
// Payload size is greater than packet buffer size
|
||||||
|
const int kPayloadBytes = NetEq::kMaxBytesInBuffer + 1;
|
||||||
|
uint8_t payload[kPayloadBytes] = {0};
|
||||||
|
WebRtcRTPHeader rtp_info;
|
||||||
|
PopulateRtpInfo(0, 0, &rtp_info);
|
||||||
|
rtp_info.header.payloadType = 103; // iSAC, no packet splitting.
|
||||||
|
EXPECT_EQ(NetEq::kFail,
|
||||||
|
neteq_->InsertPacket(rtp_info, payload, kPayloadBytes, 0));
|
||||||
|
EXPECT_EQ(NetEq::kOversizePacket, neteq_->LastError());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(DecoderError)) {
|
TEST_F(NetEqDecodingTest, DISABLED_ON_ANDROID(DecoderError)) {
|
||||||
const int kPayloadBytes = 100;
|
const int kPayloadBytes = 100;
|
||||||
uint8_t payload[kPayloadBytes] = {0};
|
uint8_t payload[kPayloadBytes] = {0};
|
||||||
|
Reference in New Issue
Block a user