CDImageMemory: Fix SBI loading

This commit is contained in:
Albert Liu 2020-09-26 15:42:13 -07:00
parent 659e6a2e60
commit 5f3d475f4c

View file

@ -110,20 +110,7 @@ bool CDImageMemory::CopyImage(CDImage* image, ProgressCallback* progress)
m_filename = image->GetFileName(); m_filename = image->GetFileName();
m_lba_count = image->GetLBACount(); m_lba_count = image->GetLBACount();
if (!image->Seek(0)) m_sbi.LoadSBI(FileSystem::ReplaceExtension(m_filename, "sbi").c_str());
{
progress->ModalError("Failed to seek to start of image for subq read");
return false;
}
progress->SetStatusText("Looking for invalid subchannel data...");
CDImage::SubChannelQ subq;
for (LBA lba = 0; lba < m_lba_count; lba++)
{
if (ReadSubChannelQ(&subq) && !subq.IsCRCValid())
m_sbi.AddReplacementSubChannelQ(lba, subq);
}
return Seek(1, Position{0, 0, 0}); return Seek(1, Position{0, 0, 0});
} }