@@ -27,7 +27,8 @@ typedef struct FLACsubFramesBuff_t{
2727
2828enum : uint8_t {FLACDECODER_INIT , FLACDECODER_READ_IN , FLACDECODER_WRITE_OUT };
2929enum : uint8_t {DECODE_FRAME , DECODE_SUBFRAMES , OUT_SAMPLES };
30- enum : int8_t {GIVE_NEXT_LOOP = +1 ,
30+ enum : int8_t {FLAC_PARSE_OGG_DONE = 100 ,
31+ GIVE_NEXT_LOOP = +1 ,
3132 ERR_FLAC_NONE = 0 ,
3233 ERR_FLAC_BLOCKSIZE_TOO_BIG = -1 ,
3334 ERR_FLAC_RESERVED_BLOCKSIZE_UNSUPPORTED = -2 ,
@@ -39,7 +40,8 @@ enum : int8_t {GIVE_NEXT_LOOP = +1,
3940 ERR_FLAC_RESERVED_RESIDUAL_CODING = -8 ,
4041 ERR_FLAC_WRONG_RICE_PARTITION_NR = -9 ,
4142 ERR_FLAC_BITS_PER_SAMPLE_TOO_BIG = -10 ,
42- ERR_FLAG_BITS_PER_SAMPLE_UNKNOWN = 11 };
43+ ERR_FLAG_BITS_PER_SAMPLE_UNKNOWN = -11 ,
44+ ERR_FLAC_DECODER_ASYNC = -12 };
4345
4446typedef struct FLACMetadataBlock_t {
4547 // METADATA_BLOCK_STREAMINFO
@@ -144,31 +146,31 @@ typedef struct FLACFrameHeader_t {
144146
145147int FLACFindSyncWord (unsigned char * buf , int nBytes );
146148boolean FLACFindMagicWord (unsigned char * buf , int nBytes );
147- boolean FLACFindStreamTitle (unsigned char * buf , int nBytes );
148149char * FLACgetStreamTitle ();
149- int FLACparseOggHeader ( unsigned char * buf );
150+ int FLACparseOGG ( uint8_t * inbuf , int * bytesLeft );
150151bool FLACDecoder_AllocateBuffers (void );
151152void FLACDecoder_ClearBuffer ();
152153void FLACDecoder_FreeBuffers ();
153154void FLACSetRawBlockParams (uint8_t Chans , uint32_t SampRate , uint8_t BPS , uint32_t tsis , uint32_t AuDaLength );
154155void FLACDecoderReset ();
155156int8_t FLACDecode (uint8_t * inbuf , int * bytesLeft , short * outbuf );
157+ int8_t flacDecodeFrame (uint8_t * inbuf , int * bytesLeft );
156158uint16_t FLACGetOutputSamps ();
157159uint64_t FLACGetTotoalSamplesInStream ();
158160uint8_t FLACGetBitsPerSample ();
159161uint8_t FLACGetChannels ();
160162uint32_t FLACGetSampRate ();
161163uint32_t FLACGetBitRate ();
162164uint32_t FLACGetAudioFileDuration ();
163- uint32_t readUint (uint8_t nBits );
164- int32_t readSignedInt (int nBits );
165- int64_t readRiceSignedInt (uint8_t param );
165+ uint32_t readUint (uint8_t nBits , int * bytesLeft );
166+ int32_t readSignedInt (int nBits , int * bytesLeft );
167+ int64_t readRiceSignedInt (uint8_t param , int * bytesLeft );
166168void alignToByte ();
167- int8_t decodeSubframes ();
168- int8_t decodeSubframe (uint8_t sampleDepth , uint8_t ch );
169- int8_t decodeFixedPredictionSubframe (uint8_t predOrder , uint8_t sampleDepth , uint8_t ch );
170- int8_t decodeLinearPredictiveCodingSubframe (int lpcOrder , int sampleDepth , uint8_t ch );
171- int8_t decodeResiduals (uint8_t warmup , uint8_t ch );
169+ int8_t decodeSubframes (int * bytesLeft );
170+ int8_t decodeSubframe (uint8_t sampleDepth , uint8_t ch , int * bytesLeft );
171+ int8_t decodeFixedPredictionSubframe (uint8_t predOrder , uint8_t sampleDepth , uint8_t ch , int * bytesLeft );
172+ int8_t decodeLinearPredictiveCodingSubframe (int lpcOrder , int sampleDepth , uint8_t ch , int * bytesLeft );
173+ int8_t decodeResiduals (uint8_t warmup , uint8_t ch , int * bytesLeft );
172174void restoreLinearPrediction (uint8_t ch , uint8_t shift );
173- int specialIndexOf (uint8_t * base , const char * str , int baselen , bool exact = false);
175+ int FLAC_specialIndexOf (uint8_t * base , const char * str , int baselen , bool exact = false);
174176
0 commit comments