Solved when CD-TEXT is bigger than 1KiB.

This commit is contained in:
2015-12-04 02:14:28 +00:00
parent 70d8743683
commit 2a1f2a9738
4 changed files with 25 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2015-12-04 Natalia Portillo <claunia@claunia.com>
* Device/ScsiCommands.cs:
Solved when CD-TEXT is bigger than 1KiB.
2015-11-24 Natalia Portillo <claunia@claunia.com> 2015-11-24 Natalia Portillo <claunia@claunia.com>
* Device/ScsiCommands.cs: * Device/ScsiCommands.cs:

View File

@@ -862,10 +862,21 @@ namespace DiscImageChef.Devices
uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2); uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
buffer = new byte[strctLength]; buffer = new byte[strctLength];
Array.Copy(tmpBuffer, 0, buffer, 0, buffer.Length);
if (buffer.Length <= tmpBuffer.Length)
{
Array.Copy(tmpBuffer, 0, buffer, 0, buffer.Length);
DicConsole.DebugWriteLine("SCSI Device", "READ TOC/PMA/ATIP took {0} ms.", duration);
return sense;
}
double tmpDuration = duration;
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
error = lastError != 0;
duration += tmpDuration;
DicConsole.DebugWriteLine("SCSI Device", "READ TOC/PMA/ATIP took {0} ms.", duration); DicConsole.DebugWriteLine("SCSI Device", "READ TOC/PMA/ATIP took {0} ms.", duration);
return sense; return sense;
} }

View File

@@ -1,3 +1,8 @@
2015-12-04 Natalia Portillo <claunia@claunia.com>
* Commands/MediaInfo.cs:
Solved when CD-TEXT is bigger than 1KiB.
2015-12-03 Natalia Portillo <claunia@claunia.com> 2015-12-03 Natalia Portillo <claunia@claunia.com>
* Commands/MediaInfo.cs: * Commands/MediaInfo.cs:

View File

@@ -801,7 +801,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("PMA:\n{0}", Decoders.CD.PMA.Prettify(cmdBuf)); DicConsole.WriteLine("PMA:\n{0}", Decoders.CD.PMA.Prettify(cmdBuf));
} }
/*sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration); sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration);
if (sense) if (sense)
DicConsole.ErrorWriteLine("READ TOC/PMA/ATIP: CD-TEXT\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); DicConsole.ErrorWriteLine("READ TOC/PMA/ATIP: CD-TEXT\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
else else
@@ -809,7 +809,7 @@ namespace DiscImageChef.Commands
doWriteFile(outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); doWriteFile(outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
//if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue) //if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue)
// DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}", Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf)); // DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}", Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf));
}*/ }
} }
} }
#endregion CDs #endregion CDs