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 AppInfoPlaylist AppInfoPlaylist
Playlist Playlist Playlist Playlist
MarkPlaylist PlaylistMark MarkPlaylist PlaylistMark
SegmentMap []string
Duration int64
} }
// AppInfoPlaylist sucks // AppInfoPlaylist sucks
@ -154,7 +156,6 @@ type AppInfoPlaylist struct {
UOMask uint64 UOMask uint64
} }
// Playlist sucks
type Playlist struct { type Playlist struct {
Len int Len int
PlayItemCount uint16 PlayItemCount uint16

View File

@ -106,7 +106,12 @@ func (mpls *MPLS) Parse(file []byte) error {
} }
// _ = mpls.MarkPlaylist.parse(reader) // _ = 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 return reader.err
} }