Skip to content

Commit

Permalink
Merge pull request clitic#19 from wcork/main
Browse files Browse the repository at this point in the history
Fix segment indexing for SegmentTemplate@duration and SegmentTemplate@index MPDs
  • Loading branch information
clitic authored Sep 9, 2023
2 parents 4f3c0a5 + 568f937 commit 556ab12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vsd/src/dash/playlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,13 @@ pub(crate) fn push_segments(mpd: &MPD, playlist: &mut MediaPlaylist, base_url: &

let mut number = segment_template.startNumber.unwrap_or(1) as i64;

let mut total_number =
number + (period_duration_secs / duration).ceil() as i64;

if init_map.is_some() {
number -= 1;
total_number -= 1;
}

let total_number =
number + (period_duration_secs / duration).ceil() as i64;

for _ in 1..=total_number {
template.insert("Number", number.to_string());

Expand Down

0 comments on commit 556ab12

Please sign in to comment.