Check speed doesn't become infinite because command duration was too low.

This commit is contained in:
2017-12-22 22:02:10 +00:00
parent 78437ef90c
commit 19914db94f
9 changed files with 40 additions and 26 deletions

View File

@@ -188,8 +188,8 @@ namespace DiscImageChef.Core.Devices.Scanning
ibgLog.Write(i, 0);
}
currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000);
GC.Collect();
double newSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000);
if(!double.IsInfinity(newSpeed)) currentSpeed = newSpeed;
}
end = DateTime.UtcNow;