Skip to content

Remove padding workaround from packetizer.GeneratePadding #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

sirzooro
Copy link
Contributor

@sirzooro sirzooro commented Jun 9, 2025

This is last part of fixes for pion/webrtc#2403 . It removes workaround from packetizer.GeneratePadding so Test_TrackLocalStatic_Padding in pion/webrtc can verify that bug is properly fixes. It also alternately sets PaddingSize field in Packet and Header to verify that both old and new fields works.

@sirzooro sirzooro requested review from JoeTurki and at-wat June 9, 2025 18:43
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.63%. Comparing base (be6ccef) to head (a023ce4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
+ Coverage   86.87%   87.63%   +0.76%     
==========================================
  Files          26       26              
  Lines        3108     3105       -3     
==========================================
+ Hits         2700     2721      +21     
+ Misses        350      325      -25     
- Partials       58       59       +1     
Flag Coverage Δ
go 87.63% <100.00%> (+0.76%) ⬆️
wasm 87.08% <100.00%> (+0.75%) ⬆️

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.

Copy link
Member

@at-wat at-wat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a scope of this PR, but it would be better to have at least a simple test for GeneratePadding. (currently not covered at all)

packetizer.go Outdated
Comment on lines 182 to 187
// Test_TrackLocalStatic_Padding in pion/webrtc transmits 20 RTP packets with padding.
// Set both old and new PaddingSize fields alternately to test both.
if seqNum%2 == 0 {
packets[i].PaddingSize = 255
} else {
packets[i].Header.PaddingSize = 255
Copy link
Member

@at-wat at-wat Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeneratePadding seems be used for bandwidth estimation and not only for testing purpose, so adding a test-only change sounds not very good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this. I have changed this to set padding size in header only.

@sirzooro sirzooro force-pushed the remove_padding_workaround branch from 6b675f8 to a1115e8 Compare June 11, 2025 15:22
@sirzooro sirzooro requested a review from at-wat June 11, 2025 15:35
@sirzooro sirzooro force-pushed the remove_padding_workaround branch from a1115e8 to a023ce4 Compare June 11, 2025 15:37
Copy link
Member

@at-wat at-wat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

@sirzooro sirzooro merged commit 08c9439 into pion:master Jun 12, 2025
14 checks passed
@sirzooro sirzooro deleted the remove_padding_workaround branch June 12, 2025 05:38
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