Skip to content

Commit

Permalink
fix: missing two or more #EXT-X-DISCONTINUITY
Browse files Browse the repository at this point in the history
  • Loading branch information
bwjun-tving committed Dec 10, 2024
1 parent 4cb35a1 commit 3f9a5df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ fn media_playlist_from_tags(mut tags: Vec<MediaPlaylistTag>) -> MediaPlaylist {
next_segment.byte_range = Some(b);
}
SegmentTag::Discontinuity => {
next_segment.discontinuity = true;
next_segment.discontinuity = next_segment.discontinuity + 1;
}
SegmentTag::Key(k) => {
encryption_keys.push(k);
Expand Down
4 changes: 2 additions & 2 deletions src/playlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ pub struct MediaSegment {
/// `#EXT-X-BYTERANGE:<n>[@<o>]`
pub byte_range: Option<ByteRange>,
/// `#EXT-X-DISCONTINUITY`
pub discontinuity: bool,
pub discontinuity: u8,
/// `#EXT-X-KEY:<attribute-list>`
pub keys: Vec<Key>,
/// `#EXT-X-MAP:<attribute-list>`
Expand All @@ -855,7 +855,7 @@ impl MediaSegment {
}

pub(crate) fn write_to<T: Write>(&self, w: &mut T) -> std::io::Result<()> {
if self.discontinuity {
for _ in 0..self.discontinuity {
writeln!(w, "#EXT-X-DISCONTINUITY")?;
}
if let Some(ref map) = self.map {
Expand Down

0 comments on commit 3f9a5df

Please sign in to comment.