Skip to content

Implement Opus packet frame parsing#89

Merged
zshang-oai merged 1 commit intopion:masterfrom
zshang-oai:codex/opus-packet-framing
Mar 25, 2026
Merged

Implement Opus packet frame parsing#89
zshang-oai merged 1 commit intopion:masterfrom
zshang-oai:codex/opus-packet-framing

Conversation

@zshang-oai
Copy link
Contributor

@zshang-oai zshang-oai commented Mar 25, 2026

Summary

  • implement Opus packet frame parsing for codes 0, 1, 2, and 3
  • enforce RFC 6716 malformed packet rules R1-R7
  • fix TOC config/frame-duration parsing bugs used by packet validation
  • add packet parser tests covering malformed rules and zero-length edge cases

(The code was created by Codex, but a human reviewed it line by line and verified it with RFC word by word)

Validation

  • go test ./... -count=1

@zshang-oai zshang-oai marked this pull request as ready for review March 25, 2026 04:24
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 82.22222% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.96%. Comparing base (abe26be) to head (740b14b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
decoder.go 81.74% 14 Missing and 9 partials ⚠️
internal/silk/decoder.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #89       +/-   ##
===========================================
+ Coverage   61.10%   72.96%   +11.85%     
===========================================
  Files           8        8               
  Lines        1085     1202      +117     
===========================================
+ Hits          663      877      +214     
+ Misses        396      292      -104     
- Partials       26       33        +7     
Flag Coverage Δ
go 72.96% <82.22%> (+11.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sean-Der
Copy link
Member

Hey @zshang-oai this is great!

I would love to get full CELT decode + CELT encode. You won't need SILK so don't worry about that :)

@Sean-Der
Copy link
Member

Can you update your commit message to be your GitHub message from above and fix the lints, then its good to merge!

@zshang-oai zshang-oai force-pushed the codex/opus-packet-framing branch from f9bb025 to 2a3242c Compare March 25, 2026 16:40
@zshang-oai
Copy link
Contributor Author

@Sean-Der I updated the PR, can you check again?

Implement Opus packet frame parsing for codes 0, 1, 2, and 3.
Enforce RFC 6716 malformed packet rules R1-R7, fix TOC
config/frame-duration parsing bugs used by packet validation, and
add packet parser tests covering malformed rules and zero-length
edge cases.

Validation:
- go test ./... -count=1
- golangci-lint run
@zshang-oai zshang-oai force-pushed the codex/opus-packet-framing branch from 2a3242c to 740b14b Compare March 25, 2026 17:23
@zshang-oai zshang-oai merged commit 806c7cb into pion:master Mar 25, 2026
18 checks passed
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