wavpack: check wvc seekability

Using wvc streams the seekableness depends on the seekability of the
wvc stream as well.
This commit is contained in:
Laszlo Ashin 2008-11-06 06:48:33 +01:00 committed by Max Kellermann
parent 56d2b51056
commit 2e0ba90208

View File

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