mirror of
https://github.com/transmission/transmission
synced 2025-02-26 07:52:38 +00:00
(libT) tweak the speed allocation a little more.
This commit is contained in:
parent
bc51d19c0d
commit
dc72deac34
1 changed files with 3 additions and 3 deletions
|
@ -254,9 +254,9 @@ tr_bandwidthAllocate( tr_bandwidth * b,
|
|||
|
||||
if( b->band[dir].isLimited )
|
||||
{
|
||||
const double currentSpeed = tr_bandwidthGetPieceSpeed( b, dir ); /* KiB/s */
|
||||
const double desiredSpeed = b->band[dir].desiredSpeed; /* KiB/s */
|
||||
const double pulseCount = HISTORY_MSEC / (double)period_msec;
|
||||
const double currentSpeed = getSpeed( &b->band[dir].piece, HISTORY_MSEC - period_msec );
|
||||
const double desiredSpeed = b->band[dir].desiredSpeed;
|
||||
const double pulseCount = ( HISTORY_MSEC - period_msec ) / (double)period_msec;
|
||||
const double nextPulseSpeed = desiredSpeed * ( pulseCount + 1 ) - ( currentSpeed * pulseCount );
|
||||
b->band[dir].bytesLeft = nextPulseSpeed * 1024.0 * period_msec / 1000.0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue