On drives that support D8h use it to read Audio CD sectors as some fail due to a firmware bug.

This commit is contained in:
2020-03-02 23:58:20 +00:00
parent 18db5ed8a5
commit f423d99b08
7 changed files with 123 additions and 21 deletions

View File

@@ -30,7 +30,8 @@ namespace Aaru.Core.Media.Info
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
public static void GetOffset(CdOffset cdOffset, Device dbDev, bool debug, Aaru.Devices.Device dev,
MediaType dskType, DumpLog dumpLog, Track[] tracks,
UpdateStatusHandler updateStatus, out int? driveOffset, out int? combinedOffset)
UpdateStatusHandler updateStatus, out int? driveOffset, out int? combinedOffset,
out bool supportsPlextorReadCdDa)
{
byte[] cmdBuf;
bool sense;
@@ -45,8 +46,9 @@ namespace Aaru.Core.Media.Info
Track audioTrack = default;
bool offsetFound = false;
const uint sectorSize = 2352;
driveOffset = cdOffset?.Offset * 4;
combinedOffset = null;
driveOffset = cdOffset?.Offset * 4;
combinedOffset = null;
supportsPlextorReadCdDa = false;
if(dskType != MediaType.VideoNowColor)
{
@@ -78,6 +80,8 @@ namespace Aaru.Core.Media.Info
if(!sense &&
!dev.Error)
{
supportsPlextorReadCdDa = true;
for(int i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
{
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);