Skip to content
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

Fix TotalLost type #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix TotalLost type #126

wants to merge 1 commit into from

Conversation

spe-dev
Copy link

@spe-dev spe-dev commented Apr 18, 2022

The TotalLost field is defined as an uint32. But RFC 3550 mentions that the field can be set with negative values as it's a int24. To avoid bit manipulation in each apps that use pion, this PR do the job during Marshal/Unmarshal funcs.
Ref: https://datatracker.ietf.org/doc/html/rfc3550 Section 6.4 & A.3

@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #126 (5f40168) into master (ad1dcea) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #126      +/-   ##
==========================================
+ Coverage   76.28%   76.37%   +0.09%     
==========================================
  Files          21       21              
  Lines        2353     2362       +9     
==========================================
+ Hits         1795     1804       +9     
  Misses        461      461              
  Partials       97       97              
Flag Coverage Δ
go 76.37% <100.00%> (+0.09%) ⬆️
wasm 76.37% <100.00%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
reception_report.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad1dcea...5f40168. Read the comment docs.

The total number of packets lost is a signed number and can be
negative to communicate multiple transmissions of a packet.
@Sean-Der
Copy link
Member

Changing this will cause the following packages to not compile, so I think it is worth a /v2 ! Great timing also, we can move pion/webrtc to the new version for 3.2.0

  • Galene
  • ion-sfu
  • LiveKit

@Sean-Der Sean-Der mentioned this pull request Apr 19, 2022
@enobufs
Copy link
Member

enobufs commented Apr 20, 2022

We could potentially get around the breaking change by adding two helper methods to ReceiptionReport:

func (*ReceptionReport) SetTotalLostInt32(totalLost int32) {...}
func (*ReceptionReport) TotalLostInt32() int32 {...}

2c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants