From 0813092c637121a161721f75c854128c9a921304 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 28 Feb 2009 19:24:40 +0100 Subject: [PATCH] audiofile: refuse to play non-seekable files If an input_stream is not seekable, libaudiofile fails to play at all: Audio File Library: unrecognized audio file format [error 0] Since we know in advance whether the input_stream is seekable, just refuse to play on a non-seekable stream. --- src/decoder/audiofile_plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/decoder/audiofile_plugin.c b/src/decoder/audiofile_plugin.c index 79a041b62..71c2cf0fa 100644 --- a/src/decoder/audiofile_plugin.c +++ b/src/decoder/audiofile_plugin.c @@ -113,6 +113,11 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is) int ret, current = 0; char chunk[CHUNK_SIZE]; + if (!is->seekable) { + g_warning("not seekable"); + return; + } + vf = setup_virtual_fops(is); af_fp = afOpenVirtualFile(vf, "r", NULL);