From 2e0ba90208260fa623e1d5c326a048c3aa5093fe Mon Sep 17 00:00:00 2001 From: Laszlo Ashin Date: Thu, 6 Nov 2008 06:48:33 +0100 Subject: wavpack: check wvc seekability Using wvc streams the seekableness depends on the seekability of the wvc stream as well. --- src/decoder/wavpack_plugin.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/decoder') 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) -- cgit v1.2.3