wavpack: be more robust if the underlying stream is not seekable

The wavpack open function gives us an option called OPEN_STREAMING. This
provides more robust and error tolerant playback, but it automatically
disables seeking. (More exactly the wavpack lib will not return the
length information.) So, if the stream is already not seekable we can
use this option safely.
This commit is contained in:
László Áshin 2008-11-14 15:23:18 +01:00 committed by Max Kellermann
parent c495c6f5af
commit 440b1ea3ea
1 changed files with 5 additions and 1 deletions

View File

@ -494,7 +494,7 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
char error[ERRORLEN];
WavpackContext *wpc;
struct input_stream is_wvc;
int open_flags = OPEN_2CH_MAX | OPEN_NORMALIZE /*| OPEN_STREAMING*/;
int open_flags = OPEN_2CH_MAX | OPEN_NORMALIZE;
struct wavpack_input isp, isp_wvc;
bool can_seek = is->seekable;
@ -503,6 +503,10 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
can_seek &= is_wvc.seekable;
}
if (!can_seek) {
open_flags |= OPEN_STREAMING;
}
wavpack_input_init(&isp, decoder, is);
wpc = WavpackOpenFileInputEx(
&mpd_is_reader, &isp, &isp_wvc, error, open_flags, 23