Do not try to read as audio data sectors with medium error.

This commit is contained in:
2021-09-05 06:48:10 +01:00
parent 5ccb874882
commit 82934f0c3d
2 changed files with 15 additions and 12 deletions

View File

@@ -166,10 +166,12 @@ namespace Aaru.Core.Devices.Dumping
{ {
if(j > (ulong)lastSector) if(j > (ulong)lastSector)
{ {
if(!failedCrossingLeadOut) if(!failedCrossingLeadOut &&
!inData)
blocksToRead += (uint)sectorsForOffset; blocksToRead += (uint)sectorsForOffset;
if(sectorsForOffset > 0) if(sectorsForOffset > 0 &&
!inData)
crossingLeadOut = true; crossingLeadOut = true;
break; break;
@@ -232,16 +234,16 @@ namespace Aaru.Core.Devices.Dumping
} }
} }
if(!inData && /* if(!inData &&
currentReadSpeed == 0xFFFF) currentReadSpeed == 0xFFFF)
{ {
_dumpLog.WriteLine("Setting speed to 8x for audio reading."); _dumpLog.WriteLine("Setting speed to 8x for audio reading.");
UpdateStatus?.Invoke("Setting speed to 8x for audio reading."); UpdateStatus?.Invoke("Setting speed to 8x for audio reading.");
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _); _dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
currentReadSpeed = 1200; currentReadSpeed = 1200;
} }*/
if(inData && currentReadSpeed != _speed) if(inData && currentReadSpeed != _speed)
{ {

View File

@@ -157,6 +157,8 @@ namespace Aaru.Core.Devices.Dumping
sectorsToTrim = (byte)(sectorsForOffset + 1); sectorsToTrim = (byte)(sectorsForOffset + 1);
} }
bool forceFixOffset = false;
if(_supportsPlextorD8 && audioExtents.Contains(badSector)) if(_supportsPlextorD8 && audioExtents.Contains(badSector))
sense = ReadPlextorWithSubchannel(out cmdBuf, out senseBuf, badSectorToRead, blockSize, sense = ReadPlextorWithSubchannel(out cmdBuf, out senseBuf, badSectorToRead, blockSize,
sectorsToTrim, supportedPlextorSubchannel, out cmdDuration); sectorsToTrim, supportedPlextorSubchannel, out cmdDuration);
@@ -197,8 +199,7 @@ namespace Aaru.Core.Devices.Dumping
DecodedSense? decSense = Sense.Decode(senseBuf); DecodedSense? decSense = Sense.Decode(senseBuf);
// Try to workaround firmware // Try to workaround firmware
if((decSense?.ASC == 0x11 && decSense?.ASCQ == 0x05) || if(decSense?.ASC == 0x64)
decSense?.ASC == 0x64)
{ {
sense = _dev.ReadCd(out cmdBuf, out _, badSectorToRead, blockSize, sectorsToTrim, sense = _dev.ReadCd(out cmdBuf, out _, badSectorToRead, blockSize, sectorsToTrim,
MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true,