Skip to content

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.

karlek and others added 8 commits January 26, 2021 02:05
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
@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!

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)

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.

karlek and others added 2 commits January 27, 2021 23:31
Co-authored-by: Robin <mewmew@users.noreply.github.com>
Co-authored-by: Robin <mewmew@users.noreply.github.com>
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