mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 23:57:54 +00:00
The merge pipeline concatenates stored bytes, so features it cannot reproduce faithfully are now detected and rejected with a clear error instead of silently succeeding with a broken output: - EXT-X-GAP (a hole in the merged file) and EXT-X-DISCONTINUITY (a broken timeline) - separate audio renditions referenced by the selected variant: the master EXT-X-MEDIA groups are parsed and an AUDIO group with its own URI fails the resolve; unreferenced groups are ignored - changing init sections: a repeated EXT-X-MAP is compared by all of its attributes (URI and BYTERANGE), not just the URI - encrypted EXT-X-MAP without an explicit IV: the spec does not define a sequence-derived IV for init sections - non-identity AES-128 KEYFORMAT values The supported matrix is documented in the package doc. Add regression tests for every rejection plus real media validation: ffmpeg-generated TS segments and fMP4 init/fragments are committed as fixtures, downloaded through the fetcher (including an AES-128 key rotation variant), and the merged outputs are validated structurally - TS on the 188 byte grid with continuity counter rules, PAT/PMT and PES presence, fMP4 by walking the ISO-BMFF box hierarchy.
Media fixtures generated locally with FFmpeg 7.0.2 (testsrc + sine sources, no third-party content):
- sample-00.ts / sample-01.ts: one continuous MPEG-2 TS encode split at a packet boundary, so continuity counters and PCR are consistent across the segment join exactly like segments cut from a single real-time stream.
- fmp4-init.mp4: ftyp+moov init section of a fragmented MP4.
- fmp4-seg1.m4s .. fmp4-seg3.m4s: moof+mdat media fragments (styp omitted by the muxer, which is legal) split at moof boundaries from one fragmented MP4 (-movflags +frag_keyframe+empty_moov+default_base_moof -frag_duration 500000).