aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorLaszlo Ashin <kodest@gmail.com>2008-11-06 06:48:33 +0100
committerMax Kellermann <max@duempel.org>2008-11-06 06:48:33 +0100
commit2e0ba90208260fa623e1d5c326a048c3aa5093fe (patch)
tree765671a16207a90c45a204b682364e0288926e2c /src/decoder
parent56d2b510564f57ae7f5212c4ec4f81f4177fae12 (diff)
downloadmpd-2e0ba90208260fa623e1d5c326a048c3aa5093fe.tar.gz
mpd-2e0ba90208260fa623e1d5c326a048c3aa5093fe.tar.xz
mpd-2e0ba90208260fa623e1d5c326a048c3aa5093fe.zip
wavpack: check wvc seekability
Using wvc streams the seekableness depends on the seekability of the wvc stream as well.
Diffstat (limited to '')
-rw-r--r--src/decoder/wavpack_plugin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c
index 995ec9290..d8865906f 100644
--- a/src/decoder/wavpack_plugin.c
+++ b/src/decoder/wavpack_plugin.c
@@ -493,9 +493,12 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
struct input_stream is_wvc;
int open_flags = OPEN_2CH_MAX | OPEN_NORMALIZE /*| OPEN_STREAMING*/;
struct wavpack_input isp, isp_wvc;
+ bool canseek = is->seekable;
- if (wavpack_open_wvc(decoder, &is_wvc, &isp_wvc))
+ if (wavpack_open_wvc(decoder, &is_wvc, &isp_wvc)) {
open_flags |= OPEN_WVC;
+ canseek &= is_wvc.seekable;
+ }
wavpack_input_init(&isp, decoder, is);
wpc = WavpackOpenFileInputEx(&mpd_is_reader, &isp, &isp_wvc, error,
@@ -506,7 +509,7 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
return false;
}
- wavpack_decode(decoder, wpc, is->seekable, NULL);
+ wavpack_decode(decoder, wpc, canseek, NULL);
WavpackCloseFile(wpc);
if (open_flags & OPEN_WVC)