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
|
// Close closes the stream if opened through a call to Open or ParseFile, and
|
||||||
// performs no operation otherwise.
|
// performs no operation otherwise.
|
||||||
func (stream *Stream) Close() error {
|
func (stream *Stream) Close() error {
|
||||||
if r, ok := stream.r.(io.Closer); ok {
|
if stream.c != nil {
|
||||||
return r.Close()
|
return stream.c.Close()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue