|
3 | 3 | * based on Xiph.Org Foundation celt decoder |
4 | 4 | * |
5 | 5 | * Created on: 26.01.2023 |
6 | | - * Updated on: 09.09.2024 |
| 6 | + * Updated on: 03.11.2024 |
7 | 7 | */ |
8 | 8 | //---------------------------------------------------------------------------------------------------------------------- |
9 | 9 | // O G G / O P U S I M P L. |
@@ -211,6 +211,7 @@ int32_t opusDecodePage0(uint8_t* inbuf, int32_t* bytesLeft, uint32_t segmentLeng |
211 | 211 | s_opusCurrentFilePos += segmentLength; |
212 | 212 | if(ret == 1){ s_opusPageNr++;} |
213 | 213 | if(ret == 0){ log_e("OpusHead not found"); } |
| 214 | + if(ret < 0) return ret; |
214 | 215 | return OPUS_PARSE_OGG_DONE; |
215 | 216 | } |
216 | 217 | //---------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -276,7 +277,7 @@ int32_t opusDecodePage3(uint8_t* inbuf, int32_t* bytesLeft, uint32_t segmentLeng |
276 | 277 | // silk_InitDecoder(); |
277 | 278 | } |
278 | 279 |
|
279 | | - samplesPerFrame = opus_packet_get_samples_per_frame(inbuf, s_opusSamplerate); |
| 280 | + samplesPerFrame = opus_packet_get_samples_per_frame(inbuf, /*s_opusSamplerate*/ 48000); |
280 | 281 |
|
281 | 282 | FramePacking: // https://www.tech-invite.com/y65/tinv-ietf-rfc-6716-2.html 3.2. Frame Packing |
282 | 283 | //log_i("s_opusCountCode %i, configNr %i", s_opusCountCode, configNr); |
@@ -801,7 +802,7 @@ int32_t parseOpusHead(uint8_t *inbuf, int32_t nBytes){ // reference https://wik |
801 | 802 |
|
802 | 803 | if(channelCount == 0 || channelCount >2) return ERR_OPUS_CHANNELS_OUT_OF_RANGE; |
803 | 804 | s_opusChannels = channelCount; |
804 | | - if(sampleRate != 48000) return ERR_OPUS_INVALID_SAMPLERATE; |
| 805 | + if(sampleRate != 48000 && sampleRate != 44100) return ERR_OPUS_INVALID_SAMPLERATE; |
805 | 806 | s_opusSamplerate = sampleRate; |
806 | 807 | if(channelMap > 1) return ERR_OPUS_EXTRA_CHANNELS_UNSUPPORTED; |
807 | 808 |
|
|
0 commit comments