Skip to content

5.8.5

Choose a tag to compare

@superuser404notfound superuser404notfound released this 18 Jul 13:52

Fixed

Recurring green flicker mid-stream on live MPEG-TS channels whose encoder restarts or splices in place (#133 follow-up).

The 5.6.2 join gate fixed joining a live H.264 broadcast mid-stream. But digilearn-dev reported, with precise logs, that the same non-existing PPS 0 referenced / non-existing SPS 0 referenced / no frame! decode condition kept recurring later in the same session (up to 65 in a row) on some UK terrestrial channels via Xtream, visible as green frames that came back throughout playback rather than only at tune-in.

Root cause: the fMP4 avcC box (the out-of-band SPS/PPS the panel decodes against) is frozen at avformat_write_header for the muxer's lifetime. The versioned-init rotation that re-establishes a fresh avcC (a new EXT-X-MAP) only fired for an SSAI program switch, i.e. an ad creative arriving on a new video PID. An in-band parameter-set change on the same PID, an encoder restart or a regional opt-out splice, common on UK DVB, forced only a discontinuity cut and left the panel decoding the new slices against the stale avcC.

Each mid-stream keyframe now parses its in-band SPS/PPS and compares them against the sets backing the current avcC. On a divergence it rotates the muxer through the same versioned EXT-X-MAP path, so the new init segment matches the new slices. The sets are parsed directly from the bitstream, so the rotation fires whether or not the demuxer surfaces the change as AV_PKT_DATA_NEW_EXTRADATA (MPEG-TS often does not). A same-PID change stays in the same program and keeps its Dolby Vision / colour signaling; only an ad creative on a new PID drops the program's overrides.

This build also carries diagnostics to confirm the path on retest: per-epoch video PID and reconstruct state (distinguishing an in-place rotation from a producer reopen), a one-shot check of whether the demuxer emits parameter-set side data at all, a same-PID change counter, and, for the separate DisplayCriteria unchanged-skip observation in the same report, a log of the exact criteria field that diverges when a same-format zap does not skip the redundant switch.

Engine-side, so a direct consumer picks it up on the version bump with no host change.

Reported by digilearn-dev.