Don't do timeshift SlideWindow() logic for static MPD (#218)

This is a fix for issue #216 where the Representation::SlideWindow() logic was
still active even though a static MPD was being asked to be generated (using
the option -generate_static_mpd). This could cause static streams longer than
1800 seconds to start playing at (end-position-for-stream - 1800 seconds).

This change is in compliance with the current usage documentation for the
shaka-packager, which suggests that -time_shift_buffer_depth only is relevant
for dynamic media presentations.
This commit is contained in:
sylt 2017-03-24 18:37:13 +01:00 committed by Kongqun Yang
parent bc4c511ad4
commit 81beb8aeb2
1 changed files with 2 additions and 1 deletions

View File

@ -1308,7 +1308,8 @@ bool Representation::IsContiguous(uint64_t start_time,
void Representation::SlideWindow() { void Representation::SlideWindow() {
DCHECK(!segment_infos_.empty()); DCHECK(!segment_infos_.empty());
if (mpd_options_.time_shift_buffer_depth <= 0.0) if (mpd_options_.time_shift_buffer_depth <= 0.0 ||
mpd_options_.mpd_type == MpdType::kStatic)
return; return;
const uint32_t time_scale = GetTimeScale(media_info_); const uint32_t time_scale = GetTimeScale(media_info_);