Skip to content

Commit

Permalink
Changes as per comments - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sr1990 committed Apr 21, 2020
1 parent 8c4a666 commit c7283e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 1 addition & 5 deletions packager/mpd/base/representation.cc
Expand Up @@ -340,11 +340,7 @@ void Representation::AddSegmentInfo(int64_t start_time, int64_t duration) {

if (mpd_options_.mpd_params.target_segment_duration > 0 &&
mpd_options_.mpd_params.allow_approximate_segment_timeline) {
if (adjusted_duration == scaled_target_duration) {
start_number_ = start_time / scaled_target_duration + 1;
} else {
start_number_ = start_time / scaled_target_duration;
}
start_number_ = start_time / scaled_target_duration + 1;
stream_just_started_ = true;
}
}
Expand Down
11 changes: 2 additions & 9 deletions packager/mpd/base/xml/xml_node.cc
Expand Up @@ -58,15 +58,8 @@ bool IsTimelineConstantDuration(const std::list<SegmentInfo>& segment_infos,

const SegmentInfo& first_segment = segment_infos.front();

if (first_segment.duration < target_duration) {
if (static_cast<uint32_t>(first_segment.start_time / target_duration) !=
start_number)
return false;
} else {
if (static_cast<uint32_t>(first_segment.start_time /
first_segment.duration) != start_number - 1)
return false;
}
if (first_segment.start_time / first_segment.duration != (start_number - 1))
return false;

if (segment_infos.size() == 1)
return true;
Expand Down

0 comments on commit c7283e7

Please sign in to comment.