mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Save disc offset in metadata.
This commit is contained in:
@@ -71,6 +71,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
byte[] cmdBuf; // Data buffer
|
byte[] cmdBuf; // Data buffer
|
||||||
DumpHardwareType currentTry = null; // Current dump hardware try
|
DumpHardwareType currentTry = null; // Current dump hardware try
|
||||||
double currentSpeed = 0; // Current read speed
|
double currentSpeed = 0; // Current read speed
|
||||||
|
int? discOffset = null; // Disc write offset
|
||||||
DateTime dumpStart = DateTime.UtcNow; // Time of dump start
|
DateTime dumpStart = DateTime.UtcNow; // Time of dump start
|
||||||
DateTime end; // Time of operation end
|
DateTime end; // Time of operation end
|
||||||
ExtentsULong extents = null; // Extents
|
ExtentsULong extents = null; // Extents
|
||||||
@@ -919,7 +920,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
_dumpLog.WriteLine($"Drive reading offset is {driveOffset} bytes ({driveOffset / 4} samples).");
|
_dumpLog.WriteLine($"Drive reading offset is {driveOffset} bytes ({driveOffset / 4} samples).");
|
||||||
UpdateStatus?.Invoke($"Drive reading offset is {driveOffset} bytes ({driveOffset / 4} samples).");
|
UpdateStatus?.Invoke($"Drive reading offset is {driveOffset} bytes ({driveOffset / 4} samples).");
|
||||||
|
|
||||||
int? discOffset = offsetBytes - driveOffset;
|
discOffset = offsetBytes - driveOffset;
|
||||||
|
|
||||||
_dumpLog.WriteLine($"Disc offsets is {discOffset} bytes ({discOffset / 4} samples)");
|
_dumpLog.WriteLine($"Disc offsets is {discOffset} bytes ({discOffset / 4} samples)");
|
||||||
|
|
||||||
@@ -1057,7 +1058,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
double totalChkDuration = 0;
|
double totalChkDuration = 0;
|
||||||
|
|
||||||
if(_metadata)
|
if(_metadata)
|
||||||
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration);
|
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, sessions, out totalChkDuration,
|
||||||
|
discOffset);
|
||||||
|
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
UpdateStatus?.Invoke("");
|
UpdateStatus?.Invoke("");
|
||||||
|
|||||||
@@ -54,8 +54,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
/// <param name="mediaTags">Media tags</param>
|
/// <param name="mediaTags">Media tags</param>
|
||||||
/// <param name="sessions">Disc sessions</param>
|
/// <param name="sessions">Disc sessions</param>
|
||||||
/// <param name="totalChkDuration">Total time spent doing checksums</param>
|
/// <param name="totalChkDuration">Total time spent doing checksums</param>
|
||||||
|
/// <param name="discOffset">Disc write offset</param>
|
||||||
void WriteOpticalSidecar(uint blockSize, ulong blocks, MediaType mediaType, LayersType layers,
|
void WriteOpticalSidecar(uint blockSize, ulong blocks, MediaType mediaType, LayersType layers,
|
||||||
Dictionary<MediaTagType, byte[]> mediaTags, int sessions, out double totalChkDuration)
|
Dictionary<MediaTagType, byte[]> mediaTags, int sessions, out double totalChkDuration,
|
||||||
|
int? discOffset)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine("Creating sidecar.");
|
_dumpLog.WriteLine("Creating sidecar.");
|
||||||
var filters = new FiltersList();
|
var filters = new FiltersList();
|
||||||
@@ -120,6 +122,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
sidecar.OpticalDisc[0].Sessions = (uint)sessions;
|
sidecar.OpticalDisc[0].Sessions = (uint)sessions;
|
||||||
sidecar.OpticalDisc[0].Layers = layers;
|
sidecar.OpticalDisc[0].Layers = layers;
|
||||||
|
|
||||||
|
if(discOffset.HasValue)
|
||||||
|
{
|
||||||
|
sidecar.OpticalDisc[0].Offset = (int)(discOffset / 4);
|
||||||
|
sidecar.OpticalDisc[0].OffsetSpecified = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(mediaTags != null)
|
if(mediaTags != null)
|
||||||
foreach(KeyValuePair<MediaTagType, byte[]> tag in mediaTags.Where(tag => _outputPlugin.
|
foreach(KeyValuePair<MediaTagType, byte[]> tag in mediaTags.Where(tag => _outputPlugin.
|
||||||
SupportedMediaTags.
|
SupportedMediaTags.
|
||||||
|
|||||||
@@ -652,9 +652,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
double totalChkDuration = 0;
|
double totalChkDuration = 0;
|
||||||
|
|
||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
WriteOpticalSidecar(BLOCK_SIZE, blocks, DSK_TYPE, null, null, 1, out totalChkDuration, null);
|
||||||
WriteOpticalSidecar(BLOCK_SIZE, blocks, DSK_TYPE, null, null, 1, out totalChkDuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke("");
|
UpdateStatus?.Invoke("");
|
||||||
|
|
||||||
|
|||||||
@@ -990,7 +990,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
{
|
{
|
||||||
// TODO: Layers
|
// TODO: Layers
|
||||||
if(opticalDisc)
|
if(opticalDisc)
|
||||||
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, 1, out totalChkDuration);
|
WriteOpticalSidecar(blockSize, blocks, dskType, null, mediaTags, 1, out totalChkDuration, null);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke("Creating sidecar.");
|
UpdateStatus?.Invoke("Creating sidecar.");
|
||||||
|
|||||||
@@ -1179,7 +1179,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
Value = layerBreak
|
Value = layerBreak
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteOpticalSidecar(BLOCK_SIZE, blocks, dskType, layers, mediaTags, 1, out totalChkDuration);
|
WriteOpticalSidecar(BLOCK_SIZE, blocks, dskType, layers, mediaTags, 1, out totalChkDuration, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke("");
|
UpdateStatus?.Invoke("");
|
||||||
|
|||||||
Reference in New Issue
Block a user