aboutsummaryrefslogtreecommitdiff
path: root/src/decoder_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 9a8b803d..360df282 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -69,6 +69,8 @@ enum decoder_command decoder_get_command(mpd_unused struct decoder * decoder)
void decoder_command_finished(mpd_unused struct decoder * decoder)
{
assert(dc.command != DECODE_COMMAND_NONE);
+ assert(dc.command != DECODE_COMMAND_SEEK ||
+ dc.seekError || decoder->seeking);
dc.command = DECODE_COMMAND_NONE;
notify_signal(&pc.notify);
@@ -78,6 +80,8 @@ double decoder_seek_where(mpd_unused struct decoder * decoder)
{
assert(dc.command == DECODE_COMMAND_SEEK);
+ decoder->seeking = 1;
+
return dc.seekWhere;
}
@@ -100,7 +104,10 @@ size_t decoder_read(struct decoder *decoder,
while (1) {
/* XXX don't allow decoder==NULL */
- if (decoder != NULL && dc.command != DECODE_COMMAND_NONE)
+ if (decoder != NULL &&
+ (dc.command != DECODE_COMMAND_SEEK ||
+ !decoder->seeking) &&
+ dc.command != DECODE_COMMAND_NONE)
return 0;
nbytes = readFromInputStream(inStream, buffer, 1, length);