Fix a few small nits in NetEq4

TEST=try bots

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3431 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2013-01-30 07:37:20 +00:00
parent c21988f423
commit e1d468c019
3 changed files with 11 additions and 9 deletions

View File

@@ -359,11 +359,11 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
PacketList packet_list; PacketList packet_list;
RTPHeader main_header; RTPHeader main_header;
{ {
// Convert to webrtc::Packet. // Convert to Packet.
// Create |packet| within this separate scope, since it should not be used // Create |packet| within this separate scope, since it should not be used
// directly once it's been inserted in the packet list. This way, |packet| // directly once it's been inserted in the packet list. This way, |packet|
// is not defined outside of this block. // is not defined outside of this block.
webrtc::Packet* packet = new webrtc::Packet; Packet* packet = new Packet;
packet->header.markerBit = false; packet->header.markerBit = false;
packet->header.payloadType = rtp_header.header.payloadType; packet->header.payloadType = rtp_header.header.payloadType;
packet->header.sequenceNumber = rtp_header.header.sequenceNumber; packet->header.sequenceNumber = rtp_header.header.sequenceNumber;
@@ -1581,7 +1581,7 @@ int NetEqImpl::ExtractPackets(int required_samples, PacketList* packet_list) {
uint16_t prev_sequence_number = 0; uint16_t prev_sequence_number = 0;
bool next_packet_available = false; bool next_packet_available = false;
const webrtc::RTPHeader* header = packet_buffer_->NextRtpHeader(); const RTPHeader* header = packet_buffer_->NextRtpHeader();
assert(header); assert(header);
if (!header) { if (!header) {
return -1; return -1;
@@ -1593,7 +1593,7 @@ int NetEqImpl::ExtractPackets(int required_samples, PacketList* packet_list) {
do { do {
timestamp_ = header->timestamp; timestamp_ = header->timestamp;
int discard_count = 0; int discard_count = 0;
webrtc::Packet* packet = packet_buffer_->GetNextPacket(&discard_count); Packet* packet = packet_buffer_->GetNextPacket(&discard_count);
// |header| may be invalid after the |packet_buffer_| operation. // |header| may be invalid after the |packet_buffer_| operation.
header = NULL; header = NULL;
if (!packet) { if (!packet) {
@@ -1737,10 +1737,8 @@ NetEqOutputType NetEqImpl::LastOutputType() {
} else if (last_mode_ == kModeExpand && expand_->MuteFactor(0) == 0) { } else if (last_mode_ == kModeExpand && expand_->MuteFactor(0) == 0) {
// Expand mode has faded down to background noise only (very long expand). // Expand mode has faded down to background noise only (very long expand).
return kOutputPLCtoCNG; return kOutputPLCtoCNG;
} else if (last_mode_ == kModeExpand) { } else if (last_mode_ == kModeExpand) {
return kOutputPLC; return kOutputPLC;
} else { } else {
return kOutputNormal; return kOutputNormal;
} }

View File

@@ -179,8 +179,12 @@ class NetEqImpl : public webrtc::NetEq {
uint32_t receive_timestamp); uint32_t receive_timestamp);
// Delivers 10 ms of audio to |output|. The number of samples produced is // Delivers 10 ms of audio data. The data is written to |output|, which can
// written to |output_length|. Returns 0 on success, or an error code. // hold (at least) |max_length| elements. The number of channels that were
// written to the output is provided in the output variable |num_channels|,
// and each channel contains |samples_per_channel| elements. If more than one
// channel is written, the samples are interleaved.
// Returns 0 on success, otherwise an error code.
int GetAudioInternal(size_t max_length, int16_t* output, int GetAudioInternal(size_t max_length, int16_t* output,
int* samples_per_channel, int* num_channels); int* samples_per_channel, int* num_channels);

View File

@@ -270,7 +270,7 @@ void NetEqDecodingTest::Process(NETEQTEST_RTPpacket* rtp, int* out_len) {
ASSERT_NE(-1, rtp->readFromFile(rtp_fp_)); ASSERT_NE(-1, rtp->readFromFile(rtp_fp_));
} }
// RecOut // Get audio from NetEq.
NetEqOutputType type; NetEqOutputType type;
int num_channels; int num_channels;
ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, out_len, ASSERT_EQ(0, neteq_->GetAudio(kMaxBlockSize, out_data_, out_len,