From 0759421d119d8d3d829978ede81683ca54d65d69 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Dec 2013 12:43:06 +0100 Subject: DecoderAPI: add function decoder_read_full() Move code from the "mad" plugin. --- src/DecoderAPI.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/DecoderAPI.hxx') diff --git a/src/DecoderAPI.hxx b/src/DecoderAPI.hxx index 50cd3e74a..a9da76305 100644 --- a/src/DecoderAPI.hxx +++ b/src/DecoderAPI.hxx @@ -112,6 +112,17 @@ decoder_read(Decoder &decoder, InputStream &is, return decoder_read(&decoder, is, buffer, length); } +/** + * Blocking read from the input stream. Attempts to fill the buffer + * completely; there is no partial result. + * + * @return true on success, false on error or command or not enough + * data + */ +bool +decoder_read_full(Decoder *decoder, InputStream &is, + void *buffer, size_t size); + /** * Skip data on the #InputStream. * -- cgit v1.2.3