mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
🐛Fix media-info not calling correct decoders on Blu-ray discs.
This commit is contained in:
@@ -247,14 +247,14 @@ namespace DiscImageChef.Commands
|
|||||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readcapacity.bin", "SCSI READ CAPACITY",
|
DataFile.WriteTo("Media-Info command", outputPrefix, "_readcapacity.bin", "SCSI READ CAPACITY",
|
||||||
cmdBuf);
|
cmdBuf);
|
||||||
blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
||||||
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]);
|
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + cmdBuf[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sense || blocks == 0xFFFFFFFF)
|
if(sense || blocks == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out _);
|
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense && blocks == 0)
|
if(sense && blocks == 0)
|
||||||
if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
|
if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
|
||||||
{
|
{
|
||||||
DicConsole.ErrorWriteLine("Unable to get media capacity");
|
DicConsole.ErrorWriteLine("Unable to get media capacity");
|
||||||
@@ -979,7 +979,8 @@ namespace DiscImageChef.Commands
|
|||||||
{
|
{
|
||||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin",
|
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin",
|
||||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||||
DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", DI.Prettify(cmdBuf));
|
DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}",
|
||||||
|
Decoders.Bluray.Cartridge.Prettify(cmdBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||||
@@ -993,7 +994,8 @@ namespace DiscImageChef.Commands
|
|||||||
{
|
{
|
||||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin",
|
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin",
|
||||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||||
DicConsole.WriteLine("Blu-ray Spare Area Information:\n{0}", DI.Prettify(cmdBuf));
|
DicConsole.WriteLine("Blu-ray Spare Area Information:\n{0}",
|
||||||
|
Decoders.Bluray.Spare.Prettify(cmdBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||||
@@ -1138,11 +1140,9 @@ namespace DiscImageChef.Commands
|
|||||||
if(toc.HasValue)
|
if(toc.HasValue)
|
||||||
foreach(TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
|
foreach(TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
|
||||||
{
|
{
|
||||||
if(track.TrackNumber == 1 &&
|
if(track.TrackNumber == 1 &&
|
||||||
((TocControl)(track.CONTROL & 0x0D) ==
|
((TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrack ||
|
||||||
TocControl.DataTrack ||
|
(TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrackIncremental))
|
||||||
(TocControl)(track.CONTROL & 0x0D) ==
|
|
||||||
TocControl.DataTrackIncremental))
|
|
||||||
allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
|
allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
|
||||||
|
|
||||||
if((TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrack ||
|
if((TocControl)(track.CONTROL & 0x0D) == TocControl.DataTrack ||
|
||||||
@@ -1157,10 +1157,10 @@ namespace DiscImageChef.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2)
|
if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2)
|
||||||
dskType = MediaType.CDPLUS;
|
dskType = MediaType.CDPLUS;
|
||||||
if(!hasDataTrack && hasAudioTrack && sessions == 1) dskType = MediaType.CDDA;
|
if(!hasDataTrack && hasAudioTrack && sessions == 1) dskType = MediaType.CDDA;
|
||||||
if(hasDataTrack && !hasAudioTrack && sessions == 1) dskType = MediaType.CDROM;
|
if(hasDataTrack && !hasAudioTrack && sessions == 1) dskType = MediaType.CDROM;
|
||||||
if(hasVideoTrack && !hasDataTrack && sessions == 1) dskType = MediaType.CDV;
|
if(hasVideoTrack && !hasDataTrack && sessions == 1) dskType = MediaType.CDV;
|
||||||
}
|
}
|
||||||
|
|
||||||
sense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out _);
|
sense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out _);
|
||||||
@@ -1179,7 +1179,7 @@ namespace DiscImageChef.Commands
|
|||||||
FullTOC.TrackDataDescriptor a0Track =
|
FullTOC.TrackDataDescriptor a0Track =
|
||||||
fullToc.Value.TrackDescriptors
|
fullToc.Value.TrackDescriptors
|
||||||
.FirstOrDefault(t => t.POINT == 0xA0 && t.ADR == 1);
|
.FirstOrDefault(t => t.POINT == 0xA0 && t.ADR == 1);
|
||||||
if(a0Track.POINT == 0xA0)
|
if(a0Track.POINT == 0xA0)
|
||||||
switch(a0Track.PSEC)
|
switch(a0Track.PSEC)
|
||||||
{
|
{
|
||||||
case 0x10:
|
case 0x10:
|
||||||
@@ -1318,9 +1318,8 @@ namespace DiscImageChef.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
||||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd,
|
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||||
0, 0,
|
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out _);
|
||||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out _);
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
DicConsole.ErrorWriteLine("Cannot get PFI.");
|
DicConsole.ErrorWriteLine("Cannot get PFI.");
|
||||||
@@ -1329,9 +1328,9 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
DicConsole.DebugWriteLine("Dump-media command", "Video partition total size: {0} sectors",
|
DicConsole.DebugWriteLine("Dump-media command", "Video partition total size: {0} sectors",
|
||||||
totalSize);
|
totalSize);
|
||||||
l0Video = PFI.Decode(cmdBuf).Value.Layer0EndPSN -
|
l0Video = PFI.Decode(cmdBuf).Value.Layer0EndPSN -
|
||||||
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1;
|
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1;
|
||||||
l1Video = totalSize - l0Video + 1;
|
l1Video = totalSize - l0Video + 1;
|
||||||
|
|
||||||
// Get game partition size
|
// Get game partition size
|
||||||
DicConsole.DebugWriteLine("Dump-media command", "Getting game partition size");
|
DicConsole.DebugWriteLine("Dump-media command", "Getting game partition size");
|
||||||
@@ -1371,9 +1370,8 @@ namespace DiscImageChef.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + cmdBuf[3]);
|
||||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd,
|
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||||
0, 0,
|
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out _);
|
||||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out _);
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
DicConsole.ErrorWriteLine("Cannot get PFI.");
|
DicConsole.ErrorWriteLine("Cannot get PFI.");
|
||||||
@@ -1383,13 +1381,12 @@ namespace DiscImageChef.Commands
|
|||||||
DicConsole.DebugWriteLine("Dump-media command", "Unlocked total size: {0} sectors",
|
DicConsole.DebugWriteLine("Dump-media command", "Unlocked total size: {0} sectors",
|
||||||
totalSize);
|
totalSize);
|
||||||
middleZone =
|
middleZone =
|
||||||
totalSize -
|
totalSize -
|
||||||
(PFI.Decode(cmdBuf).Value.Layer0EndPSN -
|
(PFI.Decode(cmdBuf).Value.Layer0EndPSN -
|
||||||
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) -
|
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) - gameSize + 1;
|
||||||
gameSize + 1;
|
|
||||||
|
|
||||||
totalSize = l0Video + l1Video + middleZone * 2 + gameSize;
|
totalSize = l0Video + l1Video + middleZone * 2 + gameSize;
|
||||||
layerBreak = l0Video + middleZone + gameSize / 2;
|
layerBreak = l0Video + middleZone + gameSize / 2;
|
||||||
|
|
||||||
DicConsole.WriteLine("Video layer 0 size: {0} sectors", l0Video);
|
DicConsole.WriteLine("Video layer 0 size: {0} sectors", l0Video);
|
||||||
DicConsole.WriteLine("Video layer 1 size: {0} sectors", l1Video);
|
DicConsole.WriteLine("Video layer 1 size: {0} sectors", l1Video);
|
||||||
|
|||||||
Reference in New Issue
Block a user