diff --git a/elementtable.go b/elementtable.go index 30baea5..c97bc7f 100644 --- a/elementtable.go +++ b/elementtable.go @@ -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}, diff --git a/elementtype.go b/elementtype.go index a24182c..4df6407 100644 --- a/elementtype.go +++ b/elementtype.go @@ -120,6 +120,7 @@ const ( ElementCueTrackPositions ElementCueTrack ElementCueClusterPosition + ElementCueBlockNumber elementMax ) @@ -296,6 +297,8 @@ func (i ElementType) String() string { return "CueTrack" case ElementCueClusterPosition: return "CueClusterPosition" + case ElementCueBlockNumber: + return "CueBlockNumber" default: return "unknown" } @@ -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 } diff --git a/marshal_roundtrip_test.go b/marshal_roundtrip_test.go index 1e4342e..ba15b8e 100644 --- a/marshal_roundtrip_test.go +++ b/marshal_roundtrip_test.go @@ -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}, }, }, }, diff --git a/webm/webm.go b/webm/webm.go index bb74523..3671e36 100644 --- a/webm/webm.go +++ b/webm/webm.go @@ -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