Flac refactor WIP

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-01-10 20:55:21 +00:00
parent cdf964f5b1
commit 27ee6af2e1
9 changed files with 282 additions and 275 deletions

View File

@@ -7,7 +7,7 @@
static OggOpusFile* opusFile;
static const OpusHead* opusHead;
static const int buffSize = 32 * 1024;
static const int buffSize = 32 * 1024;
/**
* Set decoder parameters for Opus.
@@ -16,13 +16,12 @@ static const int buffSize = 32 * 1024;
*/
void setOpus(struct decoder_fn* decoder)
{
decoder->init = initOpus;
decoder->rate = rateOpus;
/* Opus decoder always returns stereo stream */
decoder->channels = 2;
decoder->init = &initOpus;
decoder->rate = &rateOpus;
decoder->channels = &channelOpus;
decoder->buffSize = buffSize;
decoder->decode = decodeOpus;
decoder->exit = exitOpus;
decoder->decode = &decodeOpus;
decoder->exit = &exitOpus;
}
/**
@@ -57,6 +56,17 @@ uint32_t rateOpus(void)
return opusHead->input_sample_rate;
}
/**
* Get number of channels of Opus file.
*
* \return Number of channels for opened file, so always be 2.
*/
uint8_t channelOpus(void)
{
/* Opus decoder always returns stereo stream */
return 2;
}
/**
* Decode part of open Opus file.
*