Remove non-relative Seek calls from all functions.

Previously we would seek to the beginning of the io.ReadSeeker. It is much more
flexible to assume that the caller passes the ReadSeeker in an appropriate state.
This commit is contained in:
David Howden
2015-06-07 12:58:58 +10:00
parent 7f8f21cc46
commit 6df4e78d96
6 changed files with 15 additions and 46 deletions
+1 -5
View File
@@ -62,12 +62,8 @@ type metadataMP4 map[string]interface{}
// ReadAtoms reads MP4 metadata atoms from the io.ReadSeeker into a Metadata, returning
// non-nil error if there was a problem.
func ReadAtoms(r io.ReadSeeker) (Metadata, error) {
_, err := r.Seek(0, os.SEEK_SET)
if err != nil {
return nil, err
}
m := make(metadataMP4)
err = m.readAtoms(r)
err := m.readAtoms(r)
return m, err
}