aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-28 19:24:40 +0100
committerMax Kellermann <max@duempel.org>2009-02-28 19:24:40 +0100
commit0813092c637121a161721f75c854128c9a921304 (patch)
treebc91002fa7b1a2e26d43a479e507d772597bd066 /src
parent44b55bff8978239b130acd9f5cfe52b9ab2e2b92 (diff)
downloadmpd-0813092c637121a161721f75c854128c9a921304.tar.gz
mpd-0813092c637121a161721f75c854128c9a921304.tar.xz
mpd-0813092c637121a161721f75c854128c9a921304.zip
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.
Diffstat (limited to '')
-rw-r--r--src/decoder/audiofile_plugin.c5
1 files changed, 5 insertions, 0 deletions
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);