flac: fix Close method to close underlying file descriptor
This commit is contained in:
parent
d1bcf309b2
commit
ffd35219d3
4
flac.go
4
flac.go
|
@ -192,8 +192,8 @@ func ParseFile(path string) (stream *Stream, err error) {
|
|||
// Close closes the stream if opened through a call to Open or ParseFile, and
|
||||
// performs no operation otherwise.
|
||||
func (stream *Stream) Close() error {
|
||||
if r, ok := stream.r.(io.Closer); ok {
|
||||
return r.Close()
|
||||
if stream.c != nil {
|
||||
return stream.c.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue