Fix dumping correct data when reading subchannels in Plextor drives.

This commit is contained in:
2020-03-07 19:38:41 +00:00
parent 07aa1f22bc
commit 7bc33f663e
7 changed files with 103 additions and 63 deletions

View File

@@ -491,9 +491,9 @@ namespace Aaru.Core.Devices.Dumping
previousPregapIsPreviousTrack = false;
// Pregap according to Q position
posQ = ((subBuf[7] * 60 * 75) + (subBuf[8] * 75) + subBuf[9]) - 150;
int diff = posQ - lba;
int pregapQ = (int)track.TrackStartSector - lba;
posQ = ((subBuf[7] * 60 * 75) + (subBuf[8] * 75) + subBuf[9]) - 150;
int diff = posQ - lba;
int pregapQ = (int)track.TrackStartSector - lba;
if(diff != 0)
{
@@ -593,16 +593,12 @@ namespace Aaru.Core.Devices.Dumping
else if(dbDev?.ATAPI?.RemovableMedias?.Any(d => d.SupportsPlextorReadCDDA == true) == true ||
dbDev?.SCSI?.RemovableMedias?.Any(d => d.SupportsPlextorReadCDDA == true) == true ||
dev.Manufacturer.ToLowerInvariant() == "plextor")
sense = dev.PlextorReadCdDa(out cmdBuf, out _, lba, 2448, 1, PlextorSubchannel.All, dev.Timeout,
sense = dev.PlextorReadCdDa(out cmdBuf, out _, lba, 96, 1, PlextorSubchannel.All, dev.Timeout,
out _);
{
if(!sense)
{
byte[] tmpBuf = new byte[96];
Array.Copy(cmdBuf, 0, tmpBuf, 0, 96);
subBuf = DeinterleaveQ(tmpBuf);
}
subBuf = DeinterleaveQ(cmdBuf);
}
}