Skip to content

Conversation

@kixelated
Copy link
Collaborator

The previous logic would only close an audio group when the next audio frame was created. This is kind of silly, as we know the next audio frame is always going to be a keyframe. This is the cause of the "skipping slow group" console spam even though no data is being dropped.

As an optimization, we also now create a large audio group when an fMP4 fragment contains multiple audio frames. There's not much point bursting a ton of tiny audio group especially with the current "one active group" logic, although that is being fixed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

This pull request refactors the frame encoding pipeline across multiple import modules. The track producer type changes from hang::TrackProducer to moq_lite::TrackProducer in the AAC and Opus importers. In the FMP4 importer, a TrackKind enum is introduced to distinguish between video and audio tracks, affecting downstream group and frame handling logic. A new encode method is added to the Frame struct, centralizing frame encoding logic including timestamp header construction and payload chunking. The track module is simplified by delegating to this new Frame.encode method instead of handling encoding directly.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Close audio groups immediately' directly and clearly describes the main change in the changeset, which is closing audio groups without waiting for the next frame.
Description check ✅ Passed The description is well-related to the changeset, explaining the previous behavior, the problem it caused, and the improvements being made to audio group handling.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@kixelated kixelated merged commit 56edbf6 into main Jan 28, 2026
1 check passed
@kixelated kixelated deleted the close-audio branch January 28, 2026 11:52
@moq-bot moq-bot bot mentioned this pull request Jan 28, 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.

2 participants