mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Hardcode read command and blocks to read if we cannot calculate them for magneto-opticals.
This commit is contained in:
@@ -117,9 +117,15 @@ namespace Aaru.Core.Devices
|
||||
!_read12 &&
|
||||
!_read16)
|
||||
{
|
||||
ErrorMessage = "Cannot read medium, aborting scan...";
|
||||
// Magneto-opticals may have empty LBA 0 but we know they work with READ(12)
|
||||
if(_dev.ScsiType == PeripheralDeviceTypes.OpticalDevice)
|
||||
{
|
||||
ErrorMessage = "Cannot read medium, aborting scan...";
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
_read12 = true;
|
||||
}
|
||||
|
||||
if(_read6 &&
|
||||
@@ -577,6 +583,14 @@ namespace Aaru.Core.Devices
|
||||
if(!_dev.Error)
|
||||
return false;
|
||||
|
||||
// Magneto-opticals may have LBA 0 empty, we can hard code the value to a safe one
|
||||
if(_dev.ScsiType == PeripheralDeviceTypes.OpticalDevice)
|
||||
{
|
||||
BlocksToRead = 16;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BlocksToRead = 1;
|
||||
ErrorMessage = $"Device error {_dev.LastError} trying to guess ideal transfer length.";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user