First parts of layerbreak info

This commit is contained in:
Matt Nadareski
2020-09-17 10:37:04 -07:00
parent b99c48afa2
commit 17f75f3ce6

View File

@@ -1585,6 +1585,25 @@ namespace DICUI.Aaru
info.SizeAndChecksums.SHA1 = sha1;
}
// Deal with the layerbreak
string layerbreak = null;
if (type == MediaType.DVD)
layerbreak = GetLayerbreak(sidecar) ?? "";
else if (type == MediaType.BluRay)
layerbreak = (info.SizeAndChecksums.Size > 25025314816 ? "25025314816" : null);
// If we have a single-layer disc
if (string.IsNullOrWhiteSpace(layerbreak))
{
info.Extras.PVD = GeneratePVD(sidecar) ?? "Disc has no PVD";
}
// If we have a dual-layer disc
else
{
info.Extras.PVD = GeneratePVD(sidecar) ?? "Disc has no PVD";
info.SizeAndChecksums.Layerbreak = Int64.Parse(layerbreak);
}
// TODO: Investigate XGD disc outputs
// TODO: Get layerbreak information
// TODO: Investigate BD specifics like PIC
@@ -2782,6 +2801,33 @@ namespace DICUI.Aaru
}
}
/// <summary>
/// Get the layerbreak from the input file, if possible
/// </summary>
/// <param name="cicmSidecar">CICM Sidecar data generated by Aaru</param>
/// <returns>Layerbreak if possible, null on error</returns>
private static string GetLayerbreak(CICMMetadataType cicmSidecar)
{
// If the object is null, we can't get information from it
if (cicmSidecar == null)
return null;
// Only care about OpticalDisc types
if (cicmSidecar.OpticalDisc == null || cicmSidecar.OpticalDisc.Length == 0)
return null;
// Setup the layerbreak
string layerbreak = null;
// Find and return the layerbreak, if possible
foreach (OpticalDiscType opticalDisc in cicmSidecar.OpticalDisc)
{
// TODO: Determine how to find the layerbreak from the CICM
}
return layerbreak;
}
/// <summary>
/// Get the write offset from the CICM Sidecar file, if possible
/// </summary>