aac: check if the stream is seekable before length check

If the stream is not seekable, don't try to decode all frames to find
out the total song time.
This commit is contained in:
Max Kellermann 2008-11-12 07:46:01 +01:00
parent f6765c4d8b
commit 9806355d4c

View File

@ -205,7 +205,8 @@ static void aac_parse_header(AacBuffer * b, float *length)
if (length == NULL)
return;
if (b->bytesIntoBuffer >= 2 &&
if (b->inStream->seekable &&
b->bytesIntoBuffer >= 2 &&
(b->buffer[0] == 0xFF) && ((b->buffer[1] & 0xF6) == 0xF0)) {
adtsParse(b, length);
input_stream_seek(b->inStream, tagsize, SEEK_SET);