summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-12-10 00:11:29 +0100
committerMax Kellermann <max@musicpd.org>2016-12-10 00:11:29 +0100
commit7b4305d81bf29f89c232a0aba4d61817912430d8 (patch)
tree1a18c39d7ba336023290e146bca1d7bf2404edff /src/decoder
parent94e9e93fa42264dacf5b7b41c2275ab1eea64f77 (diff)
decoder/wavpack: seek errors are fatal
The libWavPack documentation says: "After a FALSE return the file should not be accessed again (other than to close it); this is a fatal error."
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/plugins/WavpackDecoderPlugin.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx
index cdbda6e1e..138556ea9 100644
--- a/src/decoder/plugins/WavpackDecoderPlugin.cxx
+++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx
@@ -217,12 +217,13 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek)
if (cmd == DecoderCommand::SEEK) {
if (can_seek) {
auto where = client.GetSeekFrame();
-
- if (WavpackSeekSample(wpc, where)) {
- client.CommandFinished();
- } else {
+ if (!WavpackSeekSample(wpc, where)) {
+ /* seek errors are fatal */
client.SeekError();
+ break;
}
+
+ client.CommandFinished();
} else {
client.SeekError();
}