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

Absolute seek #46

Merged
merged 14 commits into from
Jan 27, 2021
Merged

Absolute seek #46

merged 14 commits into from
Jan 27, 2021

Conversation

karlek
Copy link
Contributor

@karlek karlek commented Jan 25, 2021

Reference implementation for #45
Reference poc: https://github.com/karlek/catamp/tree/seek-poc

@coveralls
Copy link

coveralls commented Jan 25, 2021

Coverage Status

Coverage decreased (-0.5%) to 45.234% when pulling a3a25a9 on absolute-seek into bb157a5 on master.

Copy link
Member

@mewmew mewmew left a comment

Choose a reason for hiding this comment

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

Looks good! Added a few assorted comments. (oh, and run go fmt ^^)

Continuation of #44, fixes #45.

flac.go Outdated Show resolved Hide resolved
flac.go Outdated Show resolved Hide resolved
flac.go Outdated Show resolved Hide resolved
flac.go Show resolved Hide resolved
flac.go Show resolved Hide resolved
flac.go Outdated Show resolved Hide resolved
flac.go Outdated Show resolved Hide resolved
flac_test.go Show resolved Hide resolved
frame/frame.go Outdated Show resolved Hide resolved
flac.go Show resolved Hide resolved
@karlek
Copy link
Contributor Author

karlek commented Jan 26, 2021

// Seek seeks to the frame containing the given absolute sample number. The
// return value specifies the first sample number of the frame containing
// sampleNum.
func (stream *Stream) Seek(sampleNum uint64) (uint64, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this change!

flac.go Show resolved Hide resolved
Copy link
Member

@mewmew mewmew left a comment

Choose a reason for hiding this comment

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

Close to ready for merge. searchFromStart still needs some love, as it can reach two different panic states.

Edit: it looks like some review comments were hidden because this thread became too long. (i.e. not the resolved comments, but unresolved ones).

In particular: #46 (comment)

flac.go Outdated Show resolved Hide resolved
flac.go Show resolved Hide resolved
Copy link
Member

@mewmew mewmew left a comment

Choose a reason for hiding this comment

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

Cool to see the abs-seek branch being fuzzed as well!

The last change requested before merge is for searchFromStart to return prev instead of panic with unreachable. Other than that, it's just stylistic and personal preferences, so I'm fine to merge after adding return prev.

Great work @karlek and @cswank! We finally get seek support integrated into the FLAC library.

flac.go Outdated Show resolved Hide resolved
karlek and others added 2 commits January 27, 2021 23:31
Co-authored-by: Robin <[email protected]>
Co-authored-by: Robin <[email protected]>
Copy link
Member

@mewmew mewmew left a comment

Choose a reason for hiding this comment

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

LGTM.

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.

4 participants