diff --git a/src/common/cd_image_hasher.cpp b/src/common/cd_image_hasher.cpp index af652cf7a..69c6c6d95 100644 --- a/src/common/cd_image_hasher.cpp +++ b/src/common/cd_image_hasher.cpp @@ -46,15 +46,19 @@ static bool ReadTrack(CDImage* image, u8 track, MD5Digest* digest, ProgressCallb progress_callback->PushState(); - progress_callback->SetProgressRange(2); + const bool dataTrack = track == 1; + progress_callback->SetProgressRange(dataTrack ? 1 : 2); + + u8 progress = 0; for (u8 index = 0; index < INDICES_TO_READ; index++) { - progress_callback->SetProgressValue(index); + progress_callback->SetProgressValue(progress); // skip index 0 if data track - if (track == 1 && index == 0) + if (dataTrack && index == 0) continue; + progress++; progress_callback->PushState(); if (!ReadIndex(image, track, index, digest, progress_callback)) { @@ -66,7 +70,7 @@ static bool ReadTrack(CDImage* image, u8 track, MD5Digest* digest, ProgressCallb progress_callback->PopState(); } - progress_callback->SetProgressValue(INDICES_TO_READ); + progress_callback->SetProgressValue(progress); progress_callback->PopState(); return true; }