diff --git a/src/decoder/flac.rs b/src/decoder/flac.rs index 7b2d360e..ce6a33bc 100644 --- a/src/decoder/flac.rs +++ b/src/decoder/flac.rs @@ -124,7 +124,7 @@ fn is_flac(mut data: R) -> bool where R: Read + Seek, { - let stream_pos = data.seek(SeekFrom::Current(0)).unwrap(); + let stream_pos = data.stream_position().unwrap(); if FlacReader::new(data.by_ref()).is_err() { data.seek(SeekFrom::Start(stream_pos)).unwrap(); diff --git a/src/decoder/vorbis.rs b/src/decoder/vorbis.rs index 11a5bd9e..a02cbc0c 100644 --- a/src/decoder/vorbis.rs +++ b/src/decoder/vorbis.rs @@ -109,7 +109,7 @@ fn is_vorbis(mut data: R) -> bool where R: Read + Seek, { - let stream_pos = data.seek(SeekFrom::Current(0)).unwrap(); + let stream_pos = data.stream_position().unwrap(); if OggStreamReader::new(data.by_ref()).is_err() { data.seek(SeekFrom::Start(stream_pos)).unwrap(); diff --git a/src/decoder/wav.rs b/src/decoder/wav.rs index 5c611ee9..5b5c4267 100644 --- a/src/decoder/wav.rs +++ b/src/decoder/wav.rs @@ -154,7 +154,7 @@ fn is_wave(mut data: R) -> bool where R: Read + Seek, { - let stream_pos = data.seek(SeekFrom::Current(0)).unwrap(); + let stream_pos = data.stream_position().unwrap(); if WavReader::new(data.by_ref()).is_err() { data.seek(SeekFrom::Start(stream_pos)).unwrap();