Skip to content

fix(gst): keep waiting for a keyframe after a header-only buffer - #4356

Merged
kixelated merged 2 commits into
mainfrom
fix/gst-keyframe-latch
Sep 28, 2026
Merged

kixelated merged 2 commits into
mainfrom
fix/gst-keyframe-latch

Conversation

@kixelated

@kixelated kixelated commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #4239 (Codex P1: #4239 (comment)).

Completes and deletes quest/m1/moqsink-keyframe-latch.md.

Bug

After a video break (pause, seek, flush), moqsink drops deltas until a keyframe reopens the group. The latch was cleared after any successful decode, including one that published nothing: an SPS/PPS-only buffer decodes fine, but the H.264 split emits no frame without a slice, so no group opens. The next delta then hit MissingKeyframe and invalidated the pad permanently.

Fix

Stop clearing the latch. A delta only misses its keyframe while no group is open, which for a video pad means after a break (which re-arms the latch anyway), so there is nothing to clear once a keyframe opens the group. This avoids needing a "did decode publish a frame" signal from moq_mux::import::Track, which would be a public API change.

Regression test video_header_only_buffer_keeps_waiting_for_the_keyframe fails on main with Failed("missing keyframe ...") and passes here.

Maintainer decisions

  • The latch stays set once armed; no moq-mux API change.

Impact

  • Public API: none.
  • Wire: none.

(Written by Opus 5.5)

🤖 Generated with Claude Code

After a video break, the sink cleared its keyframe-wait latch on any
successful decode. A header-only buffer (SPS/PPS with no slice) decodes
fine but publishes no frame, so no group opened and the next delta hit
MissingKeyframe, invalidating the pad for good.

The latch now stays set once armed. A delta only misses its keyframe
while no group is open, which for video means after a break, so there
is nothing to clear once a keyframe opens the group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T17:17:49.349405Z 1428799 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

MERGE

Positive improvement: after a video break, a header-only SPS/PPS buffer can decode successfully without opening a group. Clearing the keyframe latch on that success left the next delta to hit MissingKeyframe and permanently invalidate the pad. Leaving the latch armed until a real keyframe opens the group matches the intended drop-until-keyframe behavior.

Worth the complexity: net simplification (one assignment removed) plus a focused regression test. No public API or wire change. Preferable to adding a "did publish a frame" signal from moq_mux::import::Track.

Different approach: none needed. The latch is already re-armed on discontinuity for video, and MissingKeyframe only matters while no group is open, so clearing it after every successful decode was the bug, not a required reset.

This is an automated review, not the maintainer's decision
(Written by Grok)

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 136da554-9d0b-415d-a2e4-ca4f0abdd205

📥 Commits

Reviewing files that changed from the base of the PR and between a90b404 and 1428799.

📒 Files selected for processing (2)
  • quest/m1/README.md
  • quest/m1/moqsink-keyframe-latch.md
💤 Files with no reviewable changes (2)
  • quest/m1/README.md
  • quest/m1/moqsink-keyframe-latch.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.


Walkthrough

After a video discontinuity, successful decodes no longer clear the keyframe-wait flag. Deltas remain dropped until a keyframe opens a group. A new test checks this behavior with a header-only buffer, a delta, a keyframe, and a subsequent delta. The related quest entry and proposal were removed.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 14287

The change preserves keyframe waiting after a break, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main fix: keeping the keyframe wait active after a header-only buffer.
Description check ✅ Passed The description directly explains the bug, the fix, the regression test, and the intended API and wire impact.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • Change: moqsink no longer clears its video keyframe latch after a successful decode, so a header-only (SPS/PPS) buffer after a break keeps deltas dropping until a real keyframe opens the group, instead of permanently invalidating the pad.
  • Regression test video_header_only_buffer_keeps_waiting_for_the_keyframe covers the break, headers, delta, keyframe sequence.
  • Completes and deletes quest/m1/moqsink-keyframe-latch.md.
  • Decision: the latch stays set once armed, avoiding a "did decode publish a frame" signal from moq_mux::import::Track (no public API change).
  • Reviews: Codex thumbs up on the head commit, CodeRabbit no findings, no unresolved threads. CI green. No new commits pushed during merge.
  • Public API: none. Wire: none.

(Written by Opus 5.5)

@kixelated
kixelated merged commit 6ecde63 into main Sep 28, 2026
3 checks passed
@kixelated
kixelated deleted the fix/gst-keyframe-latch branch September 28, 2026 18:29
@moq-bot moq-bot Bot mentioned this pull request Sep 28, 2026
kixelated added a commit that referenced this pull request Sep 28, 2026
Drops splice-fetch-remainder (resume-latest covers #4365 without FETCH),
trims the moqsink quest to the paths #4356 left, keeps the catalog suffix
last in per-program names, and ends the import on a later multi-program PAT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moq-bot moq-bot Bot mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant