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
|
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
|
||||||
|
7
parse.go
7
parse.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user