diff --git a/src/util/cd_image_pbp.cpp b/src/util/cd_image_pbp.cpp index 1a92bf6cb..fdbeeded5 100644 --- a/src/util/cd_image_pbp.cpp +++ b/src/util/cd_image_pbp.cpp @@ -743,12 +743,16 @@ bool CDImagePBP::OpenDisc(u32 index, Error* error) if (m_disc_offsets.size() > 1) { - const std::string offset_path = fmt::format("{}_{}.pbp", Path::StripExtension(m_filename), index + 1); + // Gross. Have to use the SBI suffix here, otherwise Android won't resolve content URIs... + // Which means that LSD won't be usable with PBP on Android. Oh well. + const std::string display_name = FileSystem::GetDisplayNameFromPath(m_filename); + const std::string offset_path = + Path::BuildRelativePath(m_filename, fmt::format("{}_{}.sbi", Path::StripExtension(display_name), index + 1)); m_sbi.LoadFromImagePath(offset_path); } else { - m_sbi.LoadFromImagePath(Path::ReplaceExtension(m_filename, "sbi")); + m_sbi.LoadFromImagePath(m_filename); } m_current_disc = index; diff --git a/src/util/cd_subchannel_replacement.cpp b/src/util/cd_subchannel_replacement.cpp index f8ae0113b..da5c11c6a 100644 --- a/src/util/cd_subchannel_replacement.cpp +++ b/src/util/cd_subchannel_replacement.cpp @@ -61,6 +61,8 @@ bool CDSubChannelReplacement::LoadSBI(const std::string& path) return true; } + m_replacement_subq.clear(); + SBIFileEntry entry; while (std::fread(&entry, sizeof(entry), 1, fp.get()) == 1) { @@ -101,6 +103,8 @@ bool CDSubChannelReplacement::LoadLSD(const std::string& path) if (!fp) return false; + m_replacement_subq.clear(); + LSDFileEntry entry; while (std::fread(&entry, sizeof(entry), 1, fp.get()) == 1) {