mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Continue calculation of pregap even if we didnt get a valid Q subchannel.
This commit is contained in:
@@ -218,8 +218,6 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
// Calculate pregap
|
// Calculate pregap
|
||||||
lba = (int)track.TrackStartSector - 150;
|
lba = (int)track.TrackStartSector - 150;
|
||||||
|
|
||||||
pregapFound = false;
|
|
||||||
|
|
||||||
while(lba > (int)previousTrack.TrackStartSector)
|
while(lba > (int)previousTrack.TrackStartSector)
|
||||||
{
|
{
|
||||||
// Some drives crash if you try to read just before the previous read, so seek away first
|
// Some drives crash if you try to read just before the previous read, so seek away first
|
||||||
@@ -237,9 +235,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
|
|
||||||
CRC16CCITTContext.Data(subBuf, 10, out crc);
|
CRC16CCITTContext.Data(subBuf, 10, out crc);
|
||||||
|
|
||||||
if(crc[0] != subBuf[10] ||
|
if(crc[0] == subBuf[10] &&
|
||||||
crc[1] != subBuf[11])
|
crc[1] == subBuf[11])
|
||||||
continue;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(retries == 10)
|
||||||
|
{
|
||||||
|
dumpLog?.WriteLine($"Could not get correct subchannel for sector {lba}");
|
||||||
|
updateStatus?.Invoke($"Could not get correct subchannel for sector {lba}");
|
||||||
|
}
|
||||||
|
|
||||||
BcdToBinaryQ(subBuf);
|
BcdToBinaryQ(subBuf);
|
||||||
|
|
||||||
@@ -252,16 +257,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
lba++;
|
lba++;
|
||||||
|
|
||||||
if(lba == (int)previousTrack.TrackStartSector)
|
if(lba == (int)previousTrack.TrackStartSector)
|
||||||
pregapFound = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search back
|
// Search back
|
||||||
goneBack = true;
|
goneBack = true;
|
||||||
lba--;
|
lba--;
|
||||||
|
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Previous track
|
// Previous track
|
||||||
@@ -273,7 +278,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
if(goneBack)
|
if(goneBack)
|
||||||
goFront = true;
|
goFront = true;
|
||||||
|
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Same track, but not pregap
|
// Same track, but not pregap
|
||||||
@@ -282,7 +287,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
{
|
{
|
||||||
lba--;
|
lba--;
|
||||||
|
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pregap according to Q position
|
// Pregap according to Q position
|
||||||
@@ -292,23 +297,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
if(pregapQ > pregaps[track.TrackSequence])
|
if(pregapQ > pregaps[track.TrackSequence])
|
||||||
pregaps[track.TrackSequence] = pregapQ;
|
pregaps[track.TrackSequence] = pregapQ;
|
||||||
else if(pregapQ == pregaps[track.TrackSequence])
|
else if(pregapQ == pregaps[track.TrackSequence])
|
||||||
pregapFound = true;
|
break;
|
||||||
|
|
||||||
lba--;
|
lba--;
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(pregapFound)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if(retries != 10)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
dumpLog?.WriteLine($"Could not calculate pregap for track {track.TrackSequence}");
|
|
||||||
updateStatus?.Invoke($"Could not calculate pregap for track {track.TrackSequence}");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user