VirtualBox

Changeset 77252 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Feb 11, 2019 8:42:08 AM (6 years ago)
Author:
vboxsync
Message:

bugref:9349. Fixed aTimeRemaining wrong calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r77204 r77252  
    572572            uint64_t ullTimeElapsed = ullTimeNow - m_ullTimestamp;
    573573            uint64_t ullTimeTotal = (uint64_t)((double)ullTimeElapsed * 100 / dPercentDone);
    574             int64_t ullTimeRemaining = ullTimeTotal - ullTimeElapsed;
     574            uint64_t ullTimeRemaining = (ullTimeTotal < ullTimeElapsed) ? 0 : ullTimeTotal - ullTimeElapsed;
    575575
    576576//          LogFunc(("dPercentDone = %RI32, ullTimeNow = %RI64, ullTimeElapsed = %RI64, ullTimeTotal = %RI64, ullTimeRemaining = %RI64\n",
    577577//                   (uint32_t)dPercentDone, ullTimeNow, ullTimeElapsed, ullTimeTotal, ullTimeRemaining));
    578578
    579             *aTimeRemaining = (LONG)(ullTimeRemaining / 1000);
     579            *aTimeRemaining = (LONG)(RT_MIN(ullTimeRemaining, RT_MS_1HOUR_64*24*365) / 1000);
    580580        }
    581581    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette