decoder/Client: add DecoderCommand/seek virtual methods

This commit is contained in:
Max Kellermann
2016-11-18 08:15:07 +01:00
parent 66fb352cca
commit 47a0f46ce8
24 changed files with 156 additions and 172 deletions

View File

@@ -170,19 +170,19 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek)
client.Ready(audio_format, can_seek, total_time);
DecoderCommand cmd = decoder_get_command(client);
DecoderCommand cmd = client.GetCommand();
while (cmd != DecoderCommand::STOP) {
if (cmd == DecoderCommand::SEEK) {
if (can_seek) {
auto where = decoder_seek_where_frame(client);
auto where = client.GetSeekFrame();
if (WavpackSeekSample(wpc, where)) {
decoder_command_finished(client);
client.CommandFinished();
} else {
decoder_seek_error(client);
client.SeekError();
}
} else {
decoder_seek_error(client);
client.SeekError();
}
}