Write subchannel log when dumping Compact Disc media.

This commit is contained in:
2020-04-27 02:29:49 +01:00
parent 728287345f
commit d0c052c347
8 changed files with 458 additions and 14 deletions

View File

@@ -36,6 +36,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Extents;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Core.Logging;
using Aaru.Decoders.SCSI;
using Aaru.Devices;
using Schemas;
@@ -50,7 +51,7 @@ namespace Aaru.Core.Devices.Dumping
{
void RetryCdUserData(ExtentsULong audioExtents, uint blockSize, DumpHardwareType currentTry,
ExtentsULong extents, int offsetBytes, bool readcd, int sectorsForOffset, uint subSize,
MmcSubchannel supportedSubchannel, ref double totalDuration)
MmcSubchannel supportedSubchannel, ref double totalDuration, SubchannelLog subLog)
{
bool sense = true; // Sense indicator
byte[] cmdBuf = null; // Data buffer
@@ -278,6 +279,7 @@ namespace Aaru.Core.Devices.Dumping
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
_outputPlugin.WriteSectorLong(data, badSector);
_outputPlugin.WriteSectorTag(sub, badSector, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, supportedSubchannel == MmcSubchannel.Raw, (long)badSector, 1);
}
else
{
@@ -375,6 +377,7 @@ namespace Aaru.Core.Devices.Dumping
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
_outputPlugin.WriteSectorLong(data, badSector);
_outputPlugin.WriteSectorTag(sub, badSector, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, supportedSubchannel == MmcSubchannel.Raw, (long)badSector, 1);
}
else
{