-
Notifications
You must be signed in to change notification settings - Fork 21
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
Make page CRC verification toggleable by end-users #44
Conversation
These changes make the Ogg page CRC verification check toggleable at runtime by end-users via a new `PageParsingOptions` struct that may be passed at reader/parser construction time. I have paid special attention to making the new feature both backwards and forwards compatible, which led me to taking the following design choices: - No signature of any existing public method was modified. People looking into changing parsing behavior via the new `PageParsingOptions` struct must use the new `*_with_parse_opts` methods. - Marking `PageParsingOptions` as `#[non_exhaustive]`, so that we may add new public fields to it in the future without a semver-breaking change. Users must always default-initialize this struct. It only derives `Clone` too, in case we ever need to make it hold non-`Copy` types. - Shared ownership of the `PageParsingOptions` between different reader structs is achieved through `Arc`s, which ensures that no struct stops being `Send` or `Sync` with a negligble performance impact. The `fuzzing` cfg flag is still honored after these changes by using it to set a default value for the new `verify_hash` page parsing option accordingly.
We required it anyway due to recent changes.
This PR also bumps the MSRV to 1.61 to fix CI checks, as it is required for the current code to work anyway (the screenshot below is from |
Resolves #101. An OptiVorbis release with this feature is blocked until RustAudio/ogg#44 gets merged and an `ogg` release with it is published, as patched dependencies can't be used on `crates.io`.
Resolves #101. An OptiVorbis release with this feature is blocked until RustAudio/ogg#44 gets merged and an `ogg` release with it is published, as patched dependencies can't be used on `crates.io`.
Resolves #101. An OptiVorbis release with this feature is blocked until RustAudio/ogg#44 gets merged and an `ogg` release with it is published, as patched dependencies can't be used on `crates.io`.
Thanks for the quick review and merge! 🚀 I was wondering if there are any plans to publish a release with these changes soon? I'd love to try them out on a new OptiVorbis release too, but no worries if we have to wait a little longer 😉 |
Hi @est31, happy new year! 🎉 I wanted to check if there are any blockers or anything you'd like to see done before a new Ogg release. Please let me know if there's any way I can help! It's been a while since my last OptiVorbis release, and I'd love to get things rolling again 🙏 |
These changes make the Ogg page CRC verification check toggleable at runtime by end-users via a new
PageParsingOptions
struct that may be passed at reader/parser construction time. I have paid special attention to making the new feature both backwards and forwards compatible, which led me to taking the following design choices:PageParsingOptions
struct must use the new*_with_parse_opts
methods.PageParsingOptions
as#[non_exhaustive]
, so that we may add new public fields to it in the future without a semver-breaking change. Users must always default-initialize this struct. It only derivesClone
too, in case we ever need to make it hold non-Copy
types.PageParsingOptions
between different reader structs is achieved throughArc
s, which ensures that no struct stops beingSend
orSync
with a negligble performance impact.The
fuzzing
cfg flag is still honored after these changes by using it to set a default value for the newverify_checksum
page parsing option accordingly.The need for these changes has been brought forward in OptiVorbis/OptiVorbis#101.