Chromium Code Reviews| Index: webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
| diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
| index 9b550cbb2bf015ae58510fe59e52488cb2068f7d..00814f1785a34887bfa1bccb570801058876f877 100644 |
| --- a/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
| +++ b/webrtc/modules/audio_coding/neteq/tools/neteq_replacement_input.cc |
| @@ -86,12 +86,16 @@ void NetEqReplacementInput::ReplacePacket() { |
| RTC_DCHECK(next_hdr); |
| uint8_t payload[12]; |
| uint32_t input_frame_size_timestamps = last_frame_size_timestamps_; |
| - if (next_hdr->sequenceNumber == packet_->header.sequenceNumber + 1) { |
| - // Packets are in order. |
| - input_frame_size_timestamps = |
| - next_hdr->timestamp - packet_->header.timestamp; |
| + const uint32_t timestamp_diff = |
| + next_hdr->timestamp - packet_->header.timestamp; |
| + if (next_hdr->sequenceNumber == packet_->header.sequenceNumber + 1 && |
| + timestamp_diff <= 120 * 48) { |
| + // Packets are in order and the timestamp diff is less than 5760 samples. |
| + // Accept the timestamp diff as a valid frame size. |
| + input_frame_size_timestamps = timestamp_diff; |
| last_frame_size_timestamps_ = input_frame_size_timestamps; |
| } |
| + RTC_DCHECK_LE(input_frame_size_timestamps, 120 * 48); |
|
AleBzk
2017/04/26 14:26:48
I'd rather do this before line 88 and on last_fram
hlundin-webrtc
2017/04/26 14:32:32
I see your point. But I think that we are not as m
|
| FakeDecodeFromFile::PrepareEncoded(packet_->header.timestamp, |
| input_frame_size_timestamps, |
| packet_->payload.size(), payload); |