added decoder_seek_where() and decoder_seek_error()

Provide access to seeking for the decoder plugins; they have to know
where to seek, and they need a way to tell us that seeking has failed.
This commit is contained in:
Max Kellermann
2008-08-26 08:27:07 +02:00
parent 78c55e2432
commit 17e9cc84c5
12 changed files with 60 additions and 42 deletions

View File

@@ -58,6 +58,21 @@ void decoder_command_finished(mpd_unused struct decoder * decoder)
notify_signal(&pc.notify);
}
double decoder_seek_where(mpd_unused struct decoder * decoder)
{
assert(dc.command == DECODE_COMMAND_SEEK);
return dc.seekWhere;
}
void decoder_seek_error(struct decoder * decoder)
{
assert(dc.command == DECODE_COMMAND_SEEK);
dc.seekError = 1;
decoder_command_finished(decoder);
}
/**
* All chunks are full of decoded data; wait for the player to free
* one.
@@ -72,8 +87,7 @@ static int need_chunks(struct decoder *decoder, InputStream * inStream,
if (seekable) {
return OUTPUT_BUFFER_DC_SEEK;
} else {
dc.seekError = 1;
decoder_command_finished(decoder);
decoder_seek_error(decoder);
}
}