Skip to content

Commit

Permalink
Adding Head method to get details of first segment
Browse files Browse the repository at this point in the history
In a sliding window playlist, we need to increase disconitnuity sequence number if the first segment of the playlist is removed. Since, there is no method or attribute exposed to get the first segment details, we are not able to obtain discontinuity flag from the it. Exposing a method to get the "head" segment of the playlist.
  • Loading branch information
pinkeshrathore committed Aug 9, 2021
1 parent 2ce07e6 commit 15f935a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ func (p *MediaPlaylist) last() uint {
return p.tail - 1
}

// head returns the first segment's index
func (p *MediaPlaylist) Head() uint {
return p.head
}

// Remove current segment from the head of chunk slice form a media playlist. Useful for sliding playlists.
// This operation does reset playlist cache.
func (p *MediaPlaylist) Remove() (err error) {
Expand Down

0 comments on commit 15f935a

Please sign in to comment.