Add SegmentMap and Duration processing
This commit is contained in:
parent
3808678a59
commit
3d80d92e2a
3
mpls.go
3
mpls.go
@ -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
|
||||
|
7
parse.go
7
parse.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user