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
9 changes: 5 additions & 4 deletions flac.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ func NewSeek(rs io.ReadSeeker) (stream *Stream, err error) {
if err != nil {
if err != meta.ErrReservedType {
return stream, err
} else {
if err = block.Skip(); err != nil {
return stream, err
}
}
if err = block.Skip(); err != nil {
return stream, err
}
}

Expand All @@ -134,6 +133,8 @@ var (
// id3Signature marks the beginning of an ID3 stream, used to skip over ID3 data.
id3Signature = []byte("ID3")

// ErrNoSeeker tells you if the Reader you passed to New/Parse is not
mewmew marked this conversation as resolved.
Show resolved Hide resolved
// a `io.ReadSeeker`, and thus does not allow for seeking.
ErrNoSeeker = errors.New("stream.Seek: reader does not implement io.Seeker")
)

Expand Down
1 change: 0 additions & 1 deletion flac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func TestSeek(t *testing.T) {
if err != nil {
if err.Error() != pos.err {
t.Fatal(err)
karlek marked this conversation as resolved.
Show resolved Hide resolved
continue
}
}

Expand Down