Add SegmentMap and Duration processing

This commit is contained in:
lordwelch 2019-05-23 09:27:44 -07:00
parent 3808678a59
commit 3d80d92e2a
2 changed files with 8 additions and 2 deletions

View File

@ -143,6 +143,8 @@ type MPLS struct {
AppInfoPlaylist AppInfoPlaylist
Playlist Playlist
MarkPlaylist PlaylistMark
SegmentMap []string
Duration int64
}
// AppInfoPlaylist sucks
@ -154,7 +156,6 @@ type AppInfoPlaylist struct {
UOMask uint64
}
// Playlist sucks
type Playlist struct {
Len int
PlayItemCount uint16

View File

@ -106,7 +106,12 @@ func (mpls *MPLS) Parse(file []byte) error {
}
// _ = mpls.MarkPlaylist.parse(reader)
mpls.SegmentMap = make([]string, 0, len(mpls.Playlist.PlayItems))
for _, playitem := range mpls.Playlist.PlayItems {
mpls.SegmentMap = append(mpls.SegmentMap, playitem.Clpi.ClipFile)
mpls.Duration += int64(playitem.OutTime - playitem.InTime)
}
mpls.Duration = mpls.Duration / 4500
return reader.err
}