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.
This commit is contained in:
Max Kellermann 2009-02-28 19:24:40 +01:00
parent 44b55bff89
commit 0813092c63
1 changed files with 5 additions and 0 deletions

View File

@ -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);