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."
This commit is contained in:
Max Kellermann 2016-12-10 00:11:29 +01:00
parent 94e9e93fa4
commit 7b4305d81b

View File

@ -217,12 +217,13 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek)
if (cmd == DecoderCommand::SEEK) { if (cmd == DecoderCommand::SEEK) {
if (can_seek) { if (can_seek) {
auto where = client.GetSeekFrame(); auto where = client.GetSeekFrame();
if (!WavpackSeekSample(wpc, where)) {
if (WavpackSeekSample(wpc, where)) { /* seek errors are fatal */
client.CommandFinished();
} else {
client.SeekError(); client.SeekError();
break;
} }
client.CommandFinished();
} else { } else {
client.SeekError(); client.SeekError();
} }