Skip to content

Commit 90c3c3f

Browse files
authored
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
1 parent b7dd856 commit 90c3c3f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

packager/mpd/base/mpd_builder.cc

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -417,19 +417,17 @@ void MpdBuilder::MakePathsRelativeToMpd(const std::string& mpd_path,
417417

418418
if (!mpd_file_path.empty()) {
419419
const std::filesystem::path mpd_dir(mpd_file_path.parent_path());
420-
if (!mpd_dir.empty()) {
421-
if (media_info->has_media_file_name()) {
422-
media_info->set_media_file_url(
423-
MakePathRelative(media_info->media_file_name(), mpd_dir));
424-
}
425-
if (media_info->has_init_segment_name()) {
426-
media_info->set_init_segment_url(
427-
MakePathRelative(media_info->init_segment_name(), mpd_dir));
428-
}
429-
if (media_info->has_segment_template()) {
430-
media_info->set_segment_template_url(
431-
MakePathRelative(media_info->segment_template(), mpd_dir));
432-
}
420+
if (media_info->has_media_file_name()) {
421+
media_info->set_media_file_url(
422+
MakePathRelative(media_info->media_file_name(), mpd_dir));
423+
}
424+
if (media_info->has_init_segment_name()) {
425+
media_info->set_init_segment_url(
426+
MakePathRelative(media_info->init_segment_name(), mpd_dir));
427+
}
428+
if (media_info->has_segment_template()) {
429+
media_info->set_segment_template_url(
430+
MakePathRelative(media_info->segment_template(), mpd_dir));
433431
}
434432
}
435433
}

0 commit comments

Comments
 (0)