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

2.4.0 #16

Draft
wants to merge 61 commits into
base: master
Choose a base branch
from
Draft

2.4.0 #16

wants to merge 61 commits into from

Conversation

yutotakano
Copy link
Owner

@yutotakano yutotakano commented Jul 31, 2022

Changes

  • Use cryptonite-based encryption based on compile flag (security not guaranteed)
  • Breaking changes on how play and audio resources behave: adding effects like reverb, getting metadata of playing track, etc will be easier
  • Automatically figure out if the audio requires ffmpeg or Haskell transformations, and skip if unnecessary
  • Use typed-process for safer subprocess handling with guarantees

General Changes

  • Use GitHub action CI for compile checks
  • Support GHC 9.0, 9.2 in addition to 8.10
  • Maybe introduce tests, TBD

@yutotakano yutotakano mentioned this pull request Sep 18, 2022
3 tasks
@yutotakano yutotakano self-assigned this Sep 18, 2022
No particular reason here other than future-proofness. Ubuntu 18.04
is having a brownout today in GitHub runners and was removed in a
previous commit. Having just Ubuntu 20.04 felt a little sad so I'm
adding in 22.04.

8.10.7 was chosen to be aligned to the Mac and Windows variants.
It's the main supported version for this library for now.
Previously we always wrapped `unconsumedBytes` with the Maybe
constructor, before performing prepending to `mbChunk`. This was
unnecessary computation if `unconsumedBytes` was `BS.empty` and
`mbChunk` was Nothing. The change adds an early if-conditional
for that. It also removes the Maybe wrapping, and instead uses
`fromMaybe` to unwrap the chunk from the conduit, which reduces
computation.
In the inner loop for oggPageExtractC, we prepend the unconsumed bytes
with the new chunk. Using strict bytestrings incurs a O(m+n) memcpy
cost when performing the appending, whereas if we switch to lazy
bytestrings, we get two benefits:

1. We avoid BL.toStrict when recursing, since the `binary` package
   unconditionally uses Lazy bytestrings anyway.
2. We get a faster append, since lazy bytestring append is O(m) in
   the length of the spine in the first bytestring.

There are no places within the code that are affected negatively by
this change.

Ref:
https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/src/Data.ByteString.Lazy.Internal.html#append
https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/src/Data.ByteString.Internal.html#append
The unterminated segment data parameter to the inner loop of
splitOggPackets was made lazy, since it undergoes on average at
least one or two append operations, and the less time it takes
the better. There is a justification provided as a comment.
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.

1 participant