From 9806355d4cf55eeecfd1d3123530ad8603902c5a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 12 Nov 2008 07:46:01 +0100 Subject: 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. --- src/decoder/aac_plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c index d7e6fe7f6..4e2208e6d 100644 --- a/src/decoder/aac_plugin.c +++ b/src/decoder/aac_plugin.c @@ -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); -- cgit v1.2.3