fix: BaseURL missing when MPD base path is empty (#1380)

The check for `!mpd_dir.empty()` is not needed because MakePathRelative
handles the case where the parent path is empty. As a result of this
check the base url, segment url, or segment template URLs were all
missing in cases where the mpd output was in the current working
directory.

Fixes #1378
This commit is contained in:
Cosmin Stejerean 2024-03-27 15:03:10 -04:00 committed by GitHub
parent b7dd8562cf
commit 90c3c3f9b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 13 deletions

View File

@ -417,7 +417,6 @@ void MpdBuilder::MakePathsRelativeToMpd(const std::string& mpd_path,
if (!mpd_file_path.empty()) {
const std::filesystem::path mpd_dir(mpd_file_path.parent_path());
if (!mpd_dir.empty()) {
if (media_info->has_media_file_name()) {
media_info->set_media_file_url(
MakePathRelative(media_info->media_file_name(), mpd_dir));
@ -431,7 +430,6 @@ void MpdBuilder::MakePathsRelativeToMpd(const std::string& mpd_path,
MakePathRelative(media_info->segment_template(), mpd_dir));
}
}
}
}
} // namespace shaka