aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:07 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:07 +0200
commit17e9cc84c5f94c94c71b2a808b57d4655ee21d12 (patch)
treefbb3c0e6ac5af307ae7e5a4ca4ca525f904d5740 /src/decoder_api.c
parent78c55e24324c881541a87cd0003c60f378a43d68 (diff)
downloadmpd-17e9cc84c5f94c94c71b2a808b57d4655ee21d12.tar.gz
mpd-17e9cc84c5f94c94c71b2a808b57d4655ee21d12.tar.xz
mpd-17e9cc84c5f94c94c71b2a808b57d4655ee21d12.zip
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.
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 9d9b1b903..5d5763b1f 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -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);
}
}