Merge pull request #933 from aaru-dps/fakeshemp/iso9660-bd-long

[ISO9660] Handle BD long sectors
This commit is contained in:
2026-04-12 21:11:21 +01:00
committed by GitHub
2 changed files with 18 additions and 3 deletions

View File

@@ -77,4 +77,14 @@ public sealed class Sector
}
return true;
}
public static byte[] GetUserData(byte[] data)
{
if(data.Length != 2052) return data;
byte[] sector = new byte[2048];
Array.Copy(data, 0, sector, 0, 2048);
return sector;
}
}

View File

@@ -234,9 +234,14 @@ public sealed partial class ISO9660
}
}
byte[] sectorData = data.Length == 2064
? Decoders.DVD.Sector.GetUserData(data)
: Sector.GetUserData(data, interleaved, fileNumber);
byte[] sectorData;
if(data.Length == 2064) // DVD sector
sectorData = Decoders.DVD.Sector.GetUserData(data);
else if(data.Length == 2052) // Blu-ray sector
sectorData = Decoders.Bluray.Sector.GetUserData(data);
else // CD sector
sectorData = Sector.GetUserData(data, interleaved, fileNumber);
ms.Write(sectorData, 0, sectorData.Length);
}