Ensures that arrival is past send time in SimulatedNetwork.

Bug: webrtc:8415
Change-Id: I2797c7dfb3e7b9622a12c2d1e35462e0c686fa8e
Reviewed-on: https://webrtc-review.googlesource.com/76101
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23228}
This commit is contained in:
Sebastian Jansson 2018-05-11 10:53:02 +02:00 committed by Commit Bot
parent 30bbbe8e79
commit e6c0964572

View File

@ -308,10 +308,10 @@ std::vector<PacketDeliveryInfo> SimulatedNetwork::DequeueDeliverablePackets(
bursting_ = false;
}
int64_t arrival_time_jitter_us =
random_.Gaussian(config.queue_delay_ms,
config.delay_standard_deviation_ms) *
1000;
int64_t arrival_time_jitter_us = std::max(
random_.Gaussian(config.queue_delay_ms * 1000,
config.delay_standard_deviation_ms * 1000),
0.0);
// If reordering is not allowed then adjust arrival_time_jitter
// to make sure all packets are sent in order.