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 flac.Seek() #173

Merged
merged 8 commits into from
Aug 27, 2024
Merged

Fix flac.Seek() #173

merged 8 commits into from
Aug 27, 2024

Conversation

MarkKremer
Copy link
Contributor

@MarkKremer MarkKremer commented Aug 3, 2024

flac.Seek() seems to be buggy. Let's fix it :)

  • Seeking will now seek to the exact position specified instead of the start of the frame. The mewkiz/flac can only seek to full frames because it only returns full frames.
  • Decoding now fills samples directly from frame without a buffer in between.
  • Seek didn't clear the internal buffer, the point above resolves this problem as well.
  • Removed unnecessary casting, which collapsed the big switch case into a simple if statement.
  • Replaced the FLAC file in the internal/testdata directory because it didn't actually seem to match the samples of the WAV file. Maybe Audacity does post-processing to it. I converted the WAV to FLAC using ffmpeg this time, which results in exact-match samples.
  • Implemented a temporary fix until frame.SampleNum() is wrong for the last frame of the stream mewkiz/flac#74 is resolved.

@MarkKremer MarkKremer marked this pull request as ready for review August 11, 2024 17:19
@MarkKremer MarkKremer merged commit 6bb4a2a into main Aug 27, 2024
1 check passed
@MarkKremer MarkKremer deleted the fix-flac-seek branch August 27, 2024 16:15
This pull request was closed.
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