always seek to start in mp3::is_mp3() (#424)

This commit is contained in:
Anatol Ulrich 2022-04-03 11:14:19 +02:00 committed by GitHub
parent 69a7f416a7
commit 55d957f8b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,10 +91,8 @@ where
{
let stream_pos = data.seek(SeekFrom::Current(0)).unwrap();
let mut decoder = Decoder::new(data.by_ref());
if decoder.next_frame().is_err() {
data.seek(SeekFrom::Start(stream_pos)).unwrap();
return false;
}
let ok = decoder.next_frame().is_ok();
data.seek(SeekFrom::Start(stream_pos)).unwrap();
true
ok
}