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

Add method to retrieve the checksum of the end page for a Packet #38

Merged
merged 2 commits into from
Aug 24, 2023
Merged

Add method to retrieve the checksum of the end page for a Packet #38

merged 2 commits into from
Aug 24, 2023

Conversation

AlexTMjugador
Copy link
Contributor

@AlexTMjugador AlexTMjugador commented Aug 23, 2023

The Ogg specification demands that each Ogg page has a checksum of its data for error detection and correction purposes. Logically, this checksum is an implementation detail of the Ogg transport, and higher-level decoders need not know it to parse logical bitstreams. However, specialized decoders may want to efficiently use it to compute a checksum of the data that flows through it, avoiding hashing packet data again (this is my concrete use case for that). In addition, testing code may also find use in a checksum to assert that the data of the page a packet belongs to is reasonably similar to what's expected.

Given that the Ogg parsing code already reads and compares page checksums, exposing them in the public Packet API, which already allows users to retrieve Ogg encapsulation data such as the granule position, comes at practically no additional cost.

The Ogg specification demands that each Ogg page has a checksum of its
data for error detection and correction purposes. Logically, this
checksum is an implementation detail of the Ogg transport, and
higher-level decoders need not know it to parse logical bitstreams.
However, specialized decoders may want to efficiently use it to compute
a checksum of the data that flows through it, avoiding hashing packet
data again. In addition, testing code may also find use in a checksum to
asser that the data of the page a packet belongs to is reasonably
similar to what's expected.

Given that the Ogg parsing code already reads and compares page
checksums, exposing them in the public `Packet` API, which already
allows users to retrieve Ogg encapsulation data such as the granule
position, comes at practically no additional cost.
@AlexTMjugador
Copy link
Contributor Author

AlexTMjugador commented Aug 23, 2023

It looks like a CI checks fail due to a transitive dependency on socket2 expecting a higher MSRV than 1.56.1. Please let me know if I should bother with this before merging this PR!

@est31
Copy link
Member

est31 commented Aug 23, 2023

Yeah ideally one would add sth like cargo update -p socket2 --precise <last version still working> to the CI script.

`tokio` pulled a dependency on a version of `socket2` that had a too
high MSRV. Because the `tokio` `socket2` version dependency range starts
at a too new `socket2` version, it's necessary to downgrade `tokio` to
the last version that has a MSRV compatible with ours.
@AlexTMjugador
Copy link
Contributor Author

CI is green now! 🎉

Copy link
Member

@est31 est31 left a comment

Choose a reason for hiding this comment

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

Thanks!

@est31 est31 merged commit f22b096 into RustAudio:master Aug 24, 2023
9 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