Refactor Opus decoder

Created generic playback handler, first with Opus support. Other
decoders to follow. This is to remove duplicated code.

3DSX tested working with citra and N3DS.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-01-07 23:26:34 +00:00
parent c5115935d9
commit 644e501d6e
7 changed files with 251 additions and 151 deletions

View File

@@ -4,9 +4,19 @@
#define CHANNEL 0x08
/* Adds extra debugging text */
//#define DEBUG
#define DEBUG
/* Prints more error information */
#define err_print(err) \
do { fprintf(stderr, "\nError %d:%s(): %s %s\n", __LINE__, __func__, \
err, strerror(errno)); } while (0)
struct decoder_fn
{
int (* init)(const char* file);
uint32_t (* rate)(void);
uint8_t channels;
int buffSize;
uint64_t (* decode)(void*);
void (* exit)(void);
};