NetEq: Remove special case for Merge without Expand
This was an ill tested special case which turned out to be more problem than benefit. The special case was only triggered when the decoder frame size was smaller than 10 ms, which is more or less unsupported by NetEq. Also fixed a bug in a test, a bug which was exposed by the code change. BUG=chromium:654983 Review-Url: https://codereview.webrtc.org/2412883002 Cr-Commit-Position: refs/heads/master@{#14627}
This commit is contained in:
committed by
Commit bot
parent
722b0dc108
commit
c9ec8758db
@ -207,12 +207,7 @@ Operations DecisionLogicNormal::FuturePacketAvailable(
|
||||
}
|
||||
}
|
||||
// Do not merge unless we have done an expand before.
|
||||
// (Convert kAllowMergeWithoutExpand from ms to samples by multiplying with
|
||||
// fs_mult_ * 8 = fs / 1000.)
|
||||
if (prev_mode == kModeExpand ||
|
||||
(decoder_frame_length < output_size_samples_ &&
|
||||
cur_size_samples >
|
||||
static_cast<size_t>(kAllowMergeWithoutExpandMs * fs_mult_ * 8))) {
|
||||
if (prev_mode == kModeExpand) {
|
||||
return kMerge;
|
||||
} else if (play_dtmf) {
|
||||
// Play DTMF instead of expand.
|
||||
|
||||
@ -40,7 +40,6 @@ class DecisionLogicNormal : public DecisionLogic {
|
||||
tick_timer) {}
|
||||
|
||||
protected:
|
||||
static const int kAllowMergeWithoutExpandMs = 20; // 20 ms.
|
||||
static const int kReinitAfterExpands = 100;
|
||||
static const int kMaxWaitForPacket = 10;
|
||||
|
||||
|
||||
@ -609,7 +609,7 @@ TEST_F(NetEqImplTest, FirstPacketUnknown) {
|
||||
const int kSampleRateHz = 8000;
|
||||
const size_t kPayloadLengthSamples =
|
||||
static_cast<size_t>(10 * kSampleRateHz / 1000); // 10 ms.
|
||||
const size_t kPayloadLengthBytes = kPayloadLengthSamples;
|
||||
const size_t kPayloadLengthBytes = kPayloadLengthSamples * 2;
|
||||
uint8_t payload[kPayloadLengthBytes] = {0};
|
||||
WebRtcRTPHeader rtp_header;
|
||||
rtp_header.header.payloadType = kPayloadType;
|
||||
|
||||
Reference in New Issue
Block a user