Skip to content

Commit

Permalink
remove mp3 decoder close method
Browse files Browse the repository at this point in the history
  • Loading branch information
Noofbiz committed Apr 6, 2019
1 parent 989c8af commit 7d671a4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions common/internal/decode/mp3/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *Stream) Close() error {
if s.resampling != nil {
return s.resampling.Close()
}
return s.orig.Close()
return nil
}

// Length returns the size of decoded stream in bytes.
Expand All @@ -60,11 +60,12 @@ func Decode(src convert.ReadSeekCloser, sr int) (*Stream, error) {
return nil, err
}
var r *convert.Resampling
if d.SampleRate() != sr {
r = convert.NewResampling(d, d.Length(), d.SampleRate(), sr)
}
return &Stream{
stream := &Stream{
orig: d,
resampling: r,
}, nil
}
if d.SampleRate() != sr {
stream.resampling = convert.NewResampling(stream, stream.orig.Length(), stream.orig.SampleRate(), sr)
}
return stream, nil
}

0 comments on commit 7d671a4

Please sign in to comment.