From 7a54a039b95d01a3c1d6db7b60cdae298de8170a Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 29 Nov 2017 15:14:21 +0000 Subject: [PATCH] Retrieve blocks of CD-R/RW before considering media is empty. Fixes #79 --- DiscImageChef.Core/Devices/Dumping/CompactDisc.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 3441fc03..8a5095c9 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -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");