Add a unit test for callbacks with empty frames and fix bug in code

This change adds a couple of new tests that verify that callbacks
with frame type kFrameEmpty are sent in between comfort noise packets.
This used to be the case until r8268, and with the fix included in
this CL is once again so.

COAUTHOR=kwiberg@webrtc.org
R=minyue@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8353}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8353 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2015-02-12 15:53:25 +00:00
parent e01264306b
commit bb1219eca3
5 changed files with 123 additions and 10 deletions

View File

@ -24,11 +24,15 @@ class AudioEncoder {
public:
struct EncodedInfoLeaf {
EncodedInfoLeaf()
: encoded_bytes(0), encoded_timestamp(0), payload_type(0) {}
: encoded_bytes(0),
encoded_timestamp(0),
payload_type(0),
send_even_if_empty(false) {}
size_t encoded_bytes;
uint32_t encoded_timestamp;
int payload_type;
bool send_even_if_empty;
};
// This is the main struct for auxiliary encoding information. Each encoded

View File

@ -154,6 +154,7 @@ bool AudioEncoderCng::EncodeInternal(uint32_t rtp_timestamp,
return_val = EncodePassive(encoded, &info->encoded_bytes);
info->encoded_timestamp = first_timestamp_in_buffer_;
info->payload_type = cng_payload_type_;
info->send_even_if_empty = true;
last_frame_active_ = false;
break;
}