Changeset 8770 for trunk/libtransmission/torrent.c
- Timestamp:
- Jul 2, 2009, 1:50:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r8768 r8770 948 948 else if( s->pieceDownloadSpeed < 0.1 ) 949 949 s->eta = TR_ETA_UNKNOWN; 950 else 951 s->eta = s->leftUntilDone / s->pieceDownloadSpeed / 1024.0; 950 else { 951 /* etaSpeed exists because if we pieceDownloadSpeed directly, 952 * brief fluctuations cause the ETA to jump all over the place. 953 * so, etaSpeed is a smoothed-out version of pieceDownloadSpeed 954 * to dampen the effect of fluctuations */ 955 if( ( tor->etaSpeedCalculatedAt + 800 ) < now ) { 956 tor->etaSpeedCalculatedAt = now; 957 tor->etaSpeed = fabs(tor->etaSpeed>0.001) 958 ? s->pieceDownloadSpeed /* if no previous speed, no need to smooth */ 959 : 0.8*tor->etaSpeed + 0.2*s->pieceDownloadSpeed; /* smooth across 5 readings */ 960 } 961 s->eta = s->leftUntilDone / tor->etaSpeed / 1024.0; 962 } 952 963 break; 953 964
Note: See TracChangeset
for help on using the changeset viewer.