Skip to content

Commit

Permalink
Fix last segment missing
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Apr 4, 2024
1 parent aa58cc7 commit 9b8a60f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/media/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,17 +592,17 @@ impl StreamData {
length: Duration::from_secs(0),
}];

for (i, number) in (self.segment_start..self.segment_lengths.len() as u32).enumerate() {
for i in 0..self.segment_lengths.len() {
segments.push(StreamSegment {
executor: self.executor.clone(),
url: format!(
"{}{}",
self.segment_base_url,
self.segment_media_url
.replace("$RepresentationID$", &self.representation_id)
.replace("$Number$", &number.to_string())
.replace("$Number$", &(self.segment_start + i as u32).to_string())
),
length: Duration::from_millis(*self.segment_lengths.get(i).unwrap() as u64),
length: Duration::from_millis(self.segment_lengths[i] as u64),
})
}

Expand Down

0 comments on commit 9b8a60f

Please sign in to comment.