audio/wav: Bug fix: add header size to offset only when whence is 0

This commit is contained in:
Hajime Hoshi 2016-03-30 02:54:25 +09:00
parent aba404d39f
commit 4e50588c0c

View File

@ -33,7 +33,10 @@ func (s *Stream) Read(p []byte) (int, error) {
}
func (s *Stream) Seek(offset int64, whence int) (int64, error) {
return s.src.Seek(offset+s.headerSize, whence)
if whence == 0 {
offset += s.headerSize
}
return s.src.Seek(offset, whence)
}
func (s *Stream) Close() error {