mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Calculate tape hashes in smaller chunks as tapes can have huge blocks.
This commit is contained in:
@@ -301,7 +301,7 @@ namespace DiscImageChef.Core
|
|||||||
// For fast debugging, skip checksum
|
// For fast debugging, skip checksum
|
||||||
//goto skipImageChecksum;
|
//goto skipImageChecksum;
|
||||||
|
|
||||||
uint sectorsToRead = 512;
|
uint sectorsToRead = 64;
|
||||||
ulong sectors = image.Info.Sectors;
|
ulong sectors = image.Info.Sectors;
|
||||||
ulong doneSectors = 0;
|
ulong doneSectors = 0;
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ namespace DiscImageChef.Core
|
|||||||
// For fast debugging, skip checksum
|
// For fast debugging, skip checksum
|
||||||
//goto skipImageChecksum;
|
//goto skipImageChecksum;
|
||||||
|
|
||||||
uint sectorsToRead = 512;
|
uint sectorsToRead = 64;
|
||||||
ulong sectors = tapePartition.LastBlock - tapePartition.FirstBlock + 1;
|
ulong sectors = tapePartition.LastBlock - tapePartition.FirstBlock + 1;
|
||||||
ulong doneSectors = 0;
|
ulong doneSectors = 0;
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ namespace DiscImageChef.Core
|
|||||||
// For fast debugging, skip checksum
|
// For fast debugging, skip checksum
|
||||||
//goto skipImageChecksum;
|
//goto skipImageChecksum;
|
||||||
|
|
||||||
uint sectorsToRead = 512;
|
uint sectorsToRead = 64;
|
||||||
ulong sectors = tapeFile.LastBlock - tapeFile.FirstBlock + 1;
|
ulong sectors = tapeFile.LastBlock - tapeFile.FirstBlock + 1;
|
||||||
ulong doneSectors = 0;
|
ulong doneSectors = 0;
|
||||||
|
|
||||||
@@ -471,13 +471,13 @@ namespace DiscImageChef.Core
|
|||||||
|
|
||||||
if(sectors - doneSectors >= sectorsToRead)
|
if(sectors - doneSectors >= sectorsToRead)
|
||||||
{
|
{
|
||||||
sector = image.ReadSectors(tapePartition.FirstBlock + doneSectors, sectorsToRead);
|
sector = image.ReadSectors(tapeFile.FirstBlock + doneSectors, sectorsToRead);
|
||||||
UpdateProgress2("Hashing blocks {0} of {1}", (long)doneSectors, (long)sectors);
|
UpdateProgress2("Hashing blocks {0} of {1}", (long)doneSectors, (long)sectors);
|
||||||
doneSectors += sectorsToRead;
|
doneSectors += sectorsToRead;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sector = image.ReadSectors(tapePartition.FirstBlock + doneSectors,
|
sector = image.ReadSectors(tapeFile.FirstBlock + doneSectors,
|
||||||
(uint)(sectors - doneSectors));
|
(uint)(sectors - doneSectors));
|
||||||
UpdateProgress2("Hashing blocks {0} of {1}", (long)doneSectors, (long)sectors);
|
UpdateProgress2("Hashing blocks {0} of {1}", (long)doneSectors, (long)sectors);
|
||||||
doneSectors += sectors - doneSectors;
|
doneSectors += sectors - doneSectors;
|
||||||
|
|||||||
Reference in New Issue
Block a user