decoder/faad: test "seekable" after ADTS frame check
Don't bother to check for ADIF just because the stream is not seekable.
This commit is contained in:
parent
18787ebe8f
commit
54b6f8a4ae
@ -186,9 +186,13 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is.IsSeekable() && length >= 2 &&
|
if (length >= 2 &&
|
||||||
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
|
data[0] == 0xFF && ((data[1] & 0xF6) == 0xF0)) {
|
||||||
/* obtain the duration from the ADTS header */
|
/* obtain the duration from the ADTS header */
|
||||||
|
|
||||||
|
if (!is.IsSeekable())
|
||||||
|
return -1;
|
||||||
|
|
||||||
float song_length = adts_song_duration(buffer);
|
float song_length = adts_song_duration(buffer);
|
||||||
|
|
||||||
is.LockSeek(tagsize, SEEK_SET, IgnoreError());
|
is.LockSeek(tagsize, SEEK_SET, IgnoreError());
|
||||||
|
Loading…
Reference in New Issue
Block a user