Commit 440b1ea3 authored by László Áshin's avatar László Áshin Committed by Max Kellermann

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.
parent c495c6f5
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment