mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Fix incorrect ETA calculation
This commit is contained in:
parent
9b71e4ffc9
commit
5f0d6f3c6d
1 changed files with 6 additions and 2 deletions
|
@ -141,6 +141,10 @@ qlonglong TorrentSpeedMonitor::getETA(const QString &hash, const libtorrent::tor
|
|||
|
||||
void TorrentSpeedMonitor::statsReceived(const stats_alert &stats)
|
||||
{
|
||||
m_samples[misc::toQString(stats.handle.info_hash())].addSample(stats.transferred[stats_alert::download_payload] * 1000 / stats.interval,
|
||||
stats.transferred[stats_alert::upload_payload] * 1000 / stats.interval);
|
||||
Q_ASSERT(stats.interval >= 1000);
|
||||
|
||||
int speedDL = static_cast<int>(static_cast<long long>(stats.transferred[stats_alert::download_payload]) * 1000 / stats.interval);
|
||||
int speedUL = static_cast<int>(static_cast<long long>(stats.transferred[stats_alert::upload_payload]) * 1000 / stats.interval);
|
||||
|
||||
m_samples[misc::toQString(stats.handle.info_hash())].addSample(speedDL, speedUL);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue