Allocate SENSE buffer only once.

This commit is contained in:
2025-08-22 19:57:09 +01:00
parent 8e2fdd91a6
commit e4f55d3b3c
73 changed files with 1892 additions and 2565 deletions

View File

@@ -59,16 +59,16 @@ public partial class Dump
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
void DumpMs()
{
const ushort sbcProfile = 0x0001;
const uint blockSize = 512;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
uint blocksToRead = 64;
MediaType dskType;
bool sense;
byte[] senseBuf;
const ushort sbcProfile = 0x0001;
const uint blockSize = 512;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
uint blocksToRead = 64;
MediaType dskType;
bool sense;
ReadOnlySpan<byte> senseBuf;
if(_outputPlugin is not IWritableImage outputFormat)
{

View File

@@ -58,14 +58,14 @@ public partial class Dump
[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
void DumpUmd()
{
const uint blockSize = 2048;
const MediaType dskType = MediaType.UMD;
uint blocksToRead = 16;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
byte[] senseBuf;
const uint blockSize = 2048;
const MediaType dskType = MediaType.UMD;
uint blocksToRead = 16;
double totalDuration = 0;
double currentSpeed = 0;
double maxSpeed = double.MinValue;
double minSpeed = double.MaxValue;
ReadOnlySpan<byte> senseBuf;
if(_outputPlugin is not IWritableOpticalImage outputOptical)
{