added decoder_read()

On our way to stabilize the decoder API, we will one day remove the
input stream functions.  The most basic function, read() will be
provided by decoder_api.h with this patch.  It already contains a loop
(still with manual polling), error/eof handling and decoder command
checks.  This kind of code used to be duplicated in all decoder
plugins.
This commit is contained in:
Max Kellermann
2008-08-26 08:27:14 +02:00
parent d80260ab4e
commit 940ecf5345
10 changed files with 50 additions and 66 deletions

View File

@@ -121,6 +121,15 @@ double decoder_seek_where(struct decoder * decoder);
void decoder_seek_error(struct decoder * decoder);
/**
* Blocking read from the input stream. Returns the number of bytes
* read, or 0 if one of the following occurs: end of file; error;
* command (like SEEK or STOP).
*/
size_t decoder_read(struct decoder *decoder,
InputStream *inStream,
void *buffer, size_t length);
/**
* This function is called by the decoder plugin when it has
* successfully decoded block of input data.