Skip to content

Commit

Permalink
Add an element "CueBlockNumber" (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamatama41 authored and at-wat committed Dec 2, 2019
1 parent 0e6763b commit 49ec691
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions elementtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var table = elementTable{
ElementSeekPosition: elementDef{[]byte{0x53, 0xAC}, TypeUInt, false},
ElementMuxingApp: elementDef{[]byte{0x4D, 0x80}, TypeString, false},
ElementName: elementDef{[]byte{0x53, 0x6E}, TypeString, false},
ElementCueBlockNumber: elementDef{[]byte{0x53, 0x78}, TypeUInt, false},
ElementCodecDelay: elementDef{[]byte{0x56, 0xAA}, TypeUInt, false},
ElementSeekPreRoll: elementDef{[]byte{0x56, 0xBB}, TypeUInt, false},
ElementWritingApp: elementDef{[]byte{0x57, 0x41}, TypeString, false},
Expand Down
5 changes: 5 additions & 0 deletions elementtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const (
ElementCueTrackPositions
ElementCueTrack
ElementCueClusterPosition
ElementCueBlockNumber

elementMax
)
Expand Down Expand Up @@ -296,6 +297,8 @@ func (i ElementType) String() string {
return "CueTrack"
case ElementCueClusterPosition:
return "CueClusterPosition"
case ElementCueBlockNumber:
return "CueBlockNumber"
default:
return "unknown"
}
Expand Down Expand Up @@ -474,6 +477,8 @@ func ElementTypeFromString(s string) (ElementType, error) {
return ElementCueTrack, nil
case "CueClusterPosition":
return ElementCueClusterPosition, nil
case "CueBlockNumber":
return ElementCueBlockNumber, nil
default:
return 0, errUnknownElementType
}
Expand Down
2 changes: 1 addition & 1 deletion marshal_roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestMarshal_RoundtripWebM(t *testing.T) {
{
CueTime: 1,
CueTrackPositions: []webm.CueTrackPosition{
{CueTrack: 2, CueClusterPosition: 3},
{CueTrack: 2, CueClusterPosition: 3, CueBlockNumber: 4},
},
},
},
Expand Down
1 change: 1 addition & 0 deletions webm/webm.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type CuePoint struct {
type CueTrackPosition struct {
CueTrack uint64 `ebml:"CueTrack"`
CueClusterPosition uint64 `ebml:"CueClusterPosition"`
CueBlockNumber uint64 `ebml:"CueBlockNumber,omitempty"`
}

// Segment represents Segment element struct
Expand Down

0 comments on commit 49ec691

Please sign in to comment.