shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.9k stars 496 forks source link

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

Closed cosmin closed 3 months ago

cosmin commented 3 months ago

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

sr1990 commented 3 months ago

Looks like this is related to change from FilePath to std::filesystem::path which expects "." to represent current directory. Do you think it makes sense to use fs::exists to see if the current directory is a real, accessible location in the filesystem and/or update the mpd_dir to current directory "." if mpd_dir.empty() is true?