• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Eyevinn / mp4ff / 37000606629
83%
master: 83%

Build:
Build:
LAST BUILD BRANCH: fix/segmenter-last-sample
DEFAULT BRANCH: master
Ran 02 Oct 2026 11:22AM UTC
Jobs 1
Files 217
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Oct 2026 11:20AM UTC coverage: 82.529% (+0.03%) from 82.497%
37000606629

Pull #612

github

tobbee
fix(mp4): add prft boxes to their fragment when decoding files

DecodeFile and DecodeFileSR put a top-level prft only in File.Children, so Fragment.Prft was nil and both Fragment.Encode and File.Encode dropped the box. ISO/IEC 14496-12:2026 clause 8.14.5 relates a prft to the following moof and places it after any styp and sidx and before that moof. For a file indexed by a sidx, whose references start at the prft, the moof did not match a segment start, so no segment existed and decoding panicked with a nil pointer.

emsg boxes had a related problem: one before the moof of any fragment but the first of a segment was added to the previous fragment, after its mdat, and with DecStartOnMoof every emsg got a segment and a fragment of its own, without moof, so File.Encode failed with "moof not set in fragment".

File.AddChild now keeps emsg and prft boxes until their moof arrives and then creates the fragment from them and the moof. Whether the fragment starts a segment is decided at its first box, which a sidx references and where DecStartOnMoof should start, and also at the moof, which a tfra points to. Boxes that no moof follows are appended to the children of the last fragment at the end of decoding, as trailing emsg boxes were before, so that they are still encoded, but not to its Emsgs or Prfts.

A fragment can have several prft boxes, one per reference track or flags value, so Fragment.Prfts now holds all of them, like Emsgs, and Fragment.Prft is the first one instead of the last. The stream decoder built its fragments with a struct literal, so it set neither Emsgs nor Prft; it now uses Fragment.AddChild.

TestDecodePreMoofBoxes covers prft, emsg and prft, three prfts, emsg and prft in later fragments, segments with styp and trailing boxes, with DecodeFile, DecodeFileSR, lazy DecodeFile and the stream decoder, and checks that File.Encode writes the input bytes. TestDecodeStartOnMoofWithEmsg and TestDecodePreMoofBoxesSegmentIndex cover DecStartOnMoof,... (continued)
Pull Request #612: fix(mp4): add prft boxes to their fragment when decoding files

45 of 45 new or added lines in 4 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

22990 of 27857 relevant lines covered (82.53%)

0.83 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
70.2
-1.32% mp4/mediasegment.go
Jobs
ID Job ID Ran Files Coverage
1 37000606629.1 02 Oct 2026 11:22AM UTC 217
82.53
GitHub Action Run
Source Files on build 37000606629
  • Tree
  • List 217
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #612
  • PR Base - master (#36999015018)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc