Merge pull request #8585 from JosJuice/volumeverifier-read-error
VolumeVerifier: Report read errors to the user
This commit is contained in:
commit
14ebdf0e9d
|
@ -1114,18 +1114,21 @@ void VolumeVerifier::Process()
|
|||
const bool is_data_needed = m_calculating_any_hash || content_read || block_read;
|
||||
const bool read_succeeded = is_data_needed && ReadChunkAndWaitForAsyncOperations(bytes_to_read);
|
||||
|
||||
if (m_calculating_any_hash)
|
||||
{
|
||||
if (!read_succeeded)
|
||||
{
|
||||
ERROR_LOG(DISCIO, "Read failed at 0x%" PRIx64 " to 0x%" PRIx64, m_progress,
|
||||
m_progress + bytes_to_read);
|
||||
|
||||
m_read_errors_occurred = true;
|
||||
m_calculating_any_hash = false;
|
||||
}
|
||||
else
|
||||
|
||||
if (m_calculating_any_hash)
|
||||
{
|
||||
if (m_hashes_to_calculate.crc32)
|
||||
{
|
||||
m_crc32_future = std::async(std::launch::async, [this] {
|
||||
// Would be nice to use crc32_z here instead of crc32, but it isn't available on Android
|
||||
// It would be nice to use crc32_z here instead of crc32, but it isn't available on Android
|
||||
m_crc32_context =
|
||||
crc32(m_crc32_context, m_data.data(), static_cast<unsigned int>(m_data.size()));
|
||||
});
|
||||
|
@ -1145,7 +1148,6 @@ void VolumeVerifier::Process()
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (content_read)
|
||||
{
|
||||
|
@ -1262,6 +1264,9 @@ void VolumeVerifier::Finish()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_read_errors_occurred)
|
||||
AddProblem(Severity::Medium, Common::GetStringT("Some of the data could not be read."));
|
||||
|
||||
if (IsDisc(m_volume.GetVolumeType()) &&
|
||||
(m_volume.IsSizeAccurate() || m_volume.SupportsIntegrityCheck()))
|
||||
{
|
||||
|
|
|
@ -174,6 +174,8 @@ private:
|
|||
bool m_redump_verification;
|
||||
RedumpVerifier m_redump_verifier;
|
||||
|
||||
bool m_read_errors_occurred = false;
|
||||
|
||||
Hashes<bool> m_hashes_to_calculate{};
|
||||
bool m_calculating_any_hash = false;
|
||||
unsigned long m_crc32_context = 0;
|
||||
|
|
Loading…
Reference in New Issue