mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Do not send to output image clusters that cross tracks.
This commit is contained in:
@@ -31,8 +31,10 @@
|
|||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using DiscImageChef.CommonTypes.Enums;
|
using DiscImageChef.CommonTypes.Enums;
|
||||||
using DiscImageChef.CommonTypes.Extents;
|
using DiscImageChef.CommonTypes.Extents;
|
||||||
|
using DiscImageChef.CommonTypes.Structs;
|
||||||
using DiscImageChef.Console;
|
using DiscImageChef.Console;
|
||||||
using DiscImageChef.Core.Logging;
|
using DiscImageChef.Core.Logging;
|
||||||
using DiscImageChef.Decoders.SCSI;
|
using DiscImageChef.Decoders.SCSI;
|
||||||
@@ -79,7 +81,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
long lastSector, ExtentsULong leadOutExtents, ref double maxSpeed, MhddLog mhddLog,
|
long lastSector, ExtentsULong leadOutExtents, ref double maxSpeed, MhddLog mhddLog,
|
||||||
ref double minSpeed, out bool newTrim, bool nextData, int offsetBytes, bool read6, bool read10,
|
ref double minSpeed, out bool newTrim, bool nextData, int offsetBytes, bool read6, bool read10,
|
||||||
bool read12, bool read16, bool readcd, int sectorsForOffset, uint subSize,
|
bool read12, bool read16, bool readcd, int sectorsForOffset, uint subSize,
|
||||||
MmcSubchannel supportedSubchannel, bool supportsLongSectors, ref double totalDuration)
|
MmcSubchannel supportedSubchannel, bool supportsLongSectors, ref double totalDuration,
|
||||||
|
Track[] tracks)
|
||||||
{
|
{
|
||||||
ulong sectorSpeedStart = 0; // Used to calculate correct speed
|
ulong sectorSpeedStart = 0; // Used to calculate correct speed
|
||||||
DateTime timeSpeedStart = DateTime.UtcNow; // Time of start for speed calculation
|
DateTime timeSpeedStart = DateTime.UtcNow; // Time of start for speed calculation
|
||||||
@@ -115,6 +118,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
|
|
||||||
uint firstSectorToRead = (uint)i;
|
uint firstSectorToRead = (uint)i;
|
||||||
|
|
||||||
|
Track track =
|
||||||
|
tracks.OrderBy(t => t.TrackStartSector).LastOrDefault(t => i >= t.TrackStartSector);
|
||||||
|
|
||||||
if((lastSector + 1) - (long)i < _maximumReadable)
|
if((lastSector + 1) - (long)i < _maximumReadable)
|
||||||
_maximumReadable = (uint)((lastSector + 1) - (long)i);
|
_maximumReadable = (uint)((lastSector + 1) - (long)i);
|
||||||
|
|
||||||
@@ -147,8 +153,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(track.TrackSequence != 0 &&
|
||||||
|
(i + blocksToRead) - (ulong)sectorsForOffset > track.TrackEndSector + 1)
|
||||||
|
blocksToRead = (uint)(((track.TrackEndSector + 1) - i) + (ulong)sectorsForOffset);
|
||||||
|
|
||||||
if(blocksToRead == 1)
|
if(blocksToRead == 1)
|
||||||
blocksToRead = 2;
|
blocksToRead += (uint)sectorsForOffset;
|
||||||
|
|
||||||
if(_fixOffset && !inData)
|
if(_fixOffset && !inData)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -872,7 +872,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
ReadCdData(audioExtents, blocks, blockSize, ref currentSpeed, currentTry, extents, ibgLog,
|
ReadCdData(audioExtents, blocks, blockSize, ref currentSpeed, currentTry, extents, ibgLog,
|
||||||
ref imageWriteDuration, lastSector, leadOutExtents, ref maxSpeed, mhddLog, ref minSpeed,
|
ref imageWriteDuration, lastSector, leadOutExtents, ref maxSpeed, mhddLog, ref minSpeed,
|
||||||
out newTrim, tracks[0].TrackType != TrackType.Audio, offsetBytes, read6, read10, read12, read16,
|
out newTrim, tracks[0].TrackType != TrackType.Audio, offsetBytes, read6, read10, read12, read16,
|
||||||
readcd, sectorsForOffset, subSize, supportedSubchannel, supportsLongSectors, ref totalDuration);
|
readcd, sectorsForOffset, subSize, supportedSubchannel, supportsLongSectors, ref totalDuration, tracks);
|
||||||
|
|
||||||
// TODO: Enable when underlying images support lead-outs
|
// TODO: Enable when underlying images support lead-outs
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user