Retrieve blocks of CD-R/RW before considering media is empty. Fixes #79

This commit is contained in:
2017-11-29 15:14:21 +00:00
parent c92ed766fe
commit 7a54a039b9

View File

@@ -114,12 +114,6 @@ namespace DiscImageChef.Core.Devices.Dumping
ATIP.CDATIP? atip = ATIP.Decode(cmdBuf);
if(atip.HasValue)
{
if(blocks == 0)
{
DicConsole.ErrorWriteLine("Cannot dump blank media.");
return;
}
// Only CD-R and CD-RW have ATIP
dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
@@ -399,6 +393,12 @@ namespace DiscImageChef.Core.Devices.Dumping
tracks[tracks.Length - 1].EndSector = lastSector;
blocks = (ulong)(lastSector + 1);
if(blocks == 0)
{
DicConsole.ErrorWriteLine("Cannot dump blank media.");
return;
}
if(dumpRaw)
{
throw new NotImplementedException("Raw CD dumping not yet implemented");