Commit c4695481 authored by Andreas Schmidt's avatar Andreas Schmidt

Pacing.

parent 90bb4cdb
Pipeline #2116 failed with stages
in 21 seconds
......@@ -102,14 +102,18 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
usleep_nano(diff / 2);
}
} while (diff > 0);
} else {
usleep_nano(1);
}
prrtTimestamp_t now = PrrtClock_get_current_time_us();
uint32_t pacing_rate = BBR_getPacingRate(sock_ptr->receiver->bbr);
if (sock_ptr->pacingEnabled && pacing_rate != 0) {
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, pacing_rate, packet->payloadLength /
pacing_rate);
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / pacing_rate)));
if (sock_ptr->pacingEnabled) {
uint32_t pacing_rate = BBR_getPacingRate(sock_ptr->receiver->bbr);
if(pacing_rate != 0) {
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, pacing_rate, packet->payloadLength /
pacing_rate);
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / pacing_rate)));
}
}
struct timespec timestamp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment