Skip to content

Commit

Permalink
test: test that CoLL and SmDm boxes are handled inside vp09
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbee committed Jan 31, 2025
1 parent 46c061f commit c6b1e9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Lots of fuzzying tests and changes to avoid panic on bad input data
- Support for SMPTE-2086 Mastering Display Metadata Box (SmDm)
- Support for Content Light Level Box (CoLL)
- Test for CoLL and SmDM inside vp09 box

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions mp4/visualsampleentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type VisualSampleEntryBox struct {
Pasp *PaspBox
Sinf *SinfBox
SmDm *SmDmBox
CoLL *CoLLBox
Children []Box
}

Expand Down Expand Up @@ -77,6 +78,8 @@ func (b *VisualSampleEntryBox) AddChild(child Box) {
b.Sinf = box
case *SmDmBox:
b.SmDm = box
case *CoLLBox:
b.CoLL = box
}
b.Children = append(b.Children, child)
}
Expand Down
5 changes: 3 additions & 2 deletions mp4/vppc.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ func DecodeVppCSR(hdr BoxHeader, startPos uint64, sr bits.SliceReader) (Box, err
if hdr.Size != b.expectedSize(codecInitSize) {
return nil, fmt.Errorf("incorrect box size")
}
b.CodecInitData = sr.ReadBytes(int(codecInitSize))

if codecInitSize != 0 {
b.CodecInitData = sr.ReadBytes(int(codecInitSize))
}
return &b, sr.AccError()
}

Expand Down

0 comments on commit c6b1e9c

Please sign in to comment.