From 3aa51835f19cba88043b17f195e20aafca2891ef Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 5 Mar 2021 22:32:51 +0100 Subject: [PATCH] merge: fix std::string to path conversion for various Blu-ray files --- src/common/bluray/disc_library.cpp | 2 +- src/common/mm_mpls_multi_file_io.cpp | 4 ++-- src/input/r_mpeg_ts.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/bluray/disc_library.cpp b/src/common/bluray/disc_library.cpp index 3e12a15d5..14f29c590 100644 --- a/src/common/bluray/disc_library.cpp +++ b/src/common/bluray/disc_library.cpp @@ -57,7 +57,7 @@ parse_bdmt_xml(std::filesystem::path const &file_name) { auto ok = false; if (thumbnail.m_file_name.is_relative()) - thumbnail.m_file_name = (mtx::fs::absolute(file_name).parent_path() / thumbnail.m_file_name).lexically_normal(); + thumbnail.m_file_name = (mtx::fs::absolute(file_name).parent_path() / mtx::fs::to_path(thumbnail.m_file_name)).lexically_normal(); mtx::regex::jp::VecNum matches; diff --git a/src/common/mm_mpls_multi_file_io.cpp b/src/common/mm_mpls_multi_file_io.cpp index ceb63cde5..c930845cb 100644 --- a/src/common/mm_mpls_multi_file_io.cpp +++ b/src/common/mm_mpls_multi_file_io.cpp @@ -58,9 +58,9 @@ mm_mpls_multi_file_io_c::open_multi(mm_io_c &in) { std::vector file_names; for (auto const &item : mpls_parser->get_playlist().items) { - auto file = mtx::bluray::find_other_file(mtx::fs::to_path(in.get_file_name()), mtx::fs::to_path("STREAM") / fmt::format("{0}.{1}", item.clip_id, balg::to_lower_copy(item.codec_id))); + auto file = mtx::bluray::find_other_file(mtx::fs::to_path(in.get_file_name()), mtx::fs::to_path("STREAM") / mtx::fs::to_path(fmt::format("{0}.{1}", item.clip_id, balg::to_lower_copy(item.codec_id)))); if (file.empty()) - file = mtx::bluray::find_other_file(mtx::fs::to_path(in.get_file_name()), mtx::fs::to_path("STREAM") / fmt::format("{0}.{1}", item.clip_id, "m2ts")); + file = mtx::bluray::find_other_file(mtx::fs::to_path(in.get_file_name()), mtx::fs::to_path("STREAM") / mtx::fs::to_path(fmt::format("{0}.{1}", item.clip_id, "m2ts"))); if (!file.empty()) file_names.push_back(file); diff --git a/src/input/r_mpeg_ts.cpp b/src/input/r_mpeg_ts.cpp index 9092db3ee..1f7d3b8ed 100644 --- a/src/input/r_mpeg_ts.cpp +++ b/src/input/r_mpeg_ts.cpp @@ -2502,7 +2502,7 @@ reader_c::parse_clip_info_file(std::size_t file_idx) { mxdebug_if(m_debug_clpi, fmt::format("find_clip_info_file: Searching for CLPI corresponding to {0}\n", source_file.u8string())); - auto clpi_file = mtx::bluray::find_other_file(source_file, mtx::fs::to_path("CLIPINF") / fmt::format("{0}.clpi", source_file.stem().u8string())); + auto clpi_file = mtx::bluray::find_other_file(source_file, mtx::fs::to_path("CLIPINF") / mtx::fs::to_path(fmt::format("{0}.clpi", source_file.stem().u8string()))); mxdebug_if(m_debug_clpi, fmt::format("reader_c::find_clip_info_file: CLPI file: {0}\n", !clpi_file.empty() ? clpi_file.u8string() : "not found")); @@ -2646,7 +2646,7 @@ reader_c::add_external_files_from_mpls(mm_mpls_multi_file_io_c &mpls_in) { continue; auto &item = sub_path.items.front(); - auto m2ts = mtx::bluray::find_other_file(mtx::fs::to_path(source_file), mtx::fs::to_path("STREAM") / fmt::format("{0}.m2ts", mtx::fs::to_path(item.clpi_file_name).stem().u8string())); + auto m2ts = mtx::bluray::find_other_file(mtx::fs::to_path(source_file), mtx::fs::to_path("STREAM") / mtx::fs::to_path(fmt::format("{0}.m2ts", mtx::fs::to_path(item.clpi_file_name).stem().u8string()))); mxdebug_if(m_debug_mpls, fmt::format("add_external_files_from_mpls: M2TS for sub_path {0}: {1}\n", sub_path_idx - 1, !m2ts.empty() ? m2ts.u8string() : "not found"));