From 98be1813bab95d2c88101c34b5ec0f01c8a0a670 Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 21 Mar 2023 23:23:37 +1300 Subject: [PATCH] Update thingy. --- DumpDVD/Gui/DumpDVD.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/DumpDVD/Gui/DumpDVD.cpp b/DumpDVD/Gui/DumpDVD.cpp index 5c3cedd..f0d09da 100644 --- a/DumpDVD/Gui/DumpDVD.cpp +++ b/DumpDVD/Gui/DumpDVD.cpp @@ -86,19 +86,25 @@ namespace Li::Gui { } void DumpDVD::reset() { - if (this->GetCurrentSelectedDrive()->DiscInDrive()) { - this->selectedDriveSpeed = this->GetCurrentSelectedDrive()->SupportedSpeeds()->size(); - if (this->GetCurrentSelectedDrive()->HasCss()) { - this->decrypt = true; + if (this->drivesList->size() > 0) { + if (this->GetCurrentSelectedDrive()->DiscInDrive()) { + this->selectedDriveSpeed = this->GetCurrentSelectedDrive()->SupportedSpeeds()->size(); + if (this->GetCurrentSelectedDrive()->HasCss()) { + this->decrypt = true; + } } + else { + this->selectedDriveSpeed = 0; + } + + std::filesystem::path p = std::filesystem::path(Utils::GetDocumentsFolder()); + p = p.append(GetCurrentSelectedDrive()->VolumeName()).replace_extension(".iso"); + strncpy(this->outputFile, p.string().c_str(), sizeof(DumpDVD::outputFile) - 1); } else { this->selectedDriveSpeed = 0; + memset(this->outputFile, 0, sizeof(DumpDVD::outputFile)); } - - std::filesystem::path p = std::filesystem::path(Utils::GetDocumentsFolder()); - p = p.append(GetCurrentSelectedDrive()->VolumeName()).replace_extension(".iso"); - strncpy(this->outputFile, p.string().c_str(), sizeof(DumpDVD::outputFile)-1); } Li::Scsi::OpticalDrive* DumpDVD::GetCurrentSelectedDrive() {