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:
parent
94e9e93fa4
commit
7b4305d81b
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user