summaryrefslogtreecommitdiff
path: root/test/FakeDecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-11-17 22:21:36 +0100
committerMax Kellermann <max@musicpd.org>2016-11-21 22:43:09 +0100
commit114fcee2ae897bd5dd740cb04a3f12b7ae60cb3f (patch)
treeac1b1a8c32dabd6f62339df66289eb28363bee8e /test/FakeDecoderAPI.cxx
parentb488204093d8fcabcb4a523da17f53276946888b (diff)
decoder/Client: add virtual method Read()
Diffstat (limited to 'test/FakeDecoderAPI.cxx')
-rw-r--r--test/FakeDecoderAPI.cxx40
1 files changed, 2 insertions, 38 deletions
diff --git a/test/FakeDecoderAPI.cxx b/test/FakeDecoderAPI.cxx
index cd8d52cf2..9204835fe 100644
--- a/test/FakeDecoderAPI.cxx
+++ b/test/FakeDecoderAPI.cxx
@@ -80,51 +80,15 @@ FakeDecoder::OpenUri(const char *uri)
}
size_t
-decoder_read(gcc_unused DecoderClient *client,
- InputStream &is,
- void *buffer, size_t length)
+FakeDecoder::Read(InputStream &is, void *buffer, size_t length)
{
try {
return is.LockRead(buffer, length);
- } catch (const std::runtime_error &) {
+ } catch (const std::runtime_error &e) {
return 0;
}
}
-bool
-decoder_read_full(DecoderClient *client, InputStream &is,
- void *_buffer, size_t size)
-{
- uint8_t *buffer = (uint8_t *)_buffer;
-
- while (size > 0) {
- size_t nbytes = decoder_read(client, is, buffer, size);
- if (nbytes == 0)
- return false;
-
- buffer += nbytes;
- size -= nbytes;
- }
-
- return true;
-}
-
-bool
-decoder_skip(DecoderClient *client, InputStream &is, size_t size)
-{
- while (size > 0) {
- char buffer[1024];
- size_t nbytes = decoder_read(client, is, buffer,
- std::min(sizeof(buffer), size));
- if (nbytes == 0)
- return false;
-
- size -= nbytes;
- }
-
- return true;
-}
-
void
FakeDecoder::SubmitTimestamp(gcc_unused double t)
{