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) { ...@@ -102,14 +102,18 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
usleep_nano(diff / 2); usleep_nano(diff / 2);
} }
} while (diff > 0); } while (diff > 0);
} else {
usleep_nano(1);
} }
prrtTimestamp_t now = PrrtClock_get_current_time_us(); prrtTimestamp_t now = PrrtClock_get_current_time_us();
uint32_t pacing_rate = BBR_getPacingRate(sock_ptr->receiver->bbr); if (sock_ptr->pacingEnabled) {
if (sock_ptr->pacingEnabled && pacing_rate != 0) { uint32_t pacing_rate = BBR_getPacingRate(sock_ptr->receiver->bbr);
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, pacing_rate, packet->payloadLength / if(pacing_rate != 0) {
pacing_rate); debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, pacing_rate, packet->payloadLength /
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / pacing_rate))); pacing_rate);
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / pacing_rate)));
}
} }
struct timespec timestamp; 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