decoder/Client: new interface which wraps struct Decoder

Prepare for a Decoder API redesign based on an abstract class with
virtual methods.
This commit is contained in:
Max Kellermann
2016-11-18 07:13:35 +01:00
parent 595d1942cb
commit fd77acc217
46 changed files with 460 additions and 407 deletions

View File

@@ -28,13 +28,13 @@
#include <string.h>
enum ogg_codec
ogg_codec_detect(Decoder *decoder, InputStream &is)
ogg_codec_detect(DecoderClient *client, InputStream &is)
{
/* oggflac detection based on code in ogg123 and this post
* http://lists.xiph.org/pipermail/flac/2004-December/000393.html
* ogg123 trunk still doesn't have this patch as of June 2005 */
unsigned char buf[41];
size_t r = decoder_read(decoder, is, buf, sizeof(buf));
size_t r = decoder_read(client, is, buf, sizeof(buf));
if (r < sizeof(buf) || memcmp(buf, "OggS", 4) != 0)
return OGG_CODEC_UNKNOWN;