diff options
Diffstat (limited to 'decoder/ixheaacd_headerdecode.c')
-rw-r--r-- | decoder/ixheaacd_headerdecode.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/decoder/ixheaacd_headerdecode.c b/decoder/ixheaacd_headerdecode.c index 2ee7201..356cf08 100644 --- a/decoder/ixheaacd_headerdecode.c +++ b/decoder/ixheaacd_headerdecode.c @@ -316,7 +316,7 @@ WORD32 ixheaacd_find_syncword(ia_adts_header_struct *adts, WORD32 ixheaacd_adtsframe(ia_adts_header_struct *adts, struct ia_bit_buf_struct *it_bit_buff) { WORD32 tmp; - + IA_ERRORCODE err = IA_NO_ERROR; WORD32 crc_reg; ia_adts_crc_info_struct *ptr_adts_crc_info = it_bit_buff->pstr_adts_crc_info; ptr_adts_crc_info->crc_active = 1; @@ -324,7 +324,8 @@ WORD32 ixheaacd_adtsframe(ia_adts_header_struct *adts, ixheaacd_read_bidirection(it_bit_buff, -12); crc_reg = ixheaacd_adts_crc_start_reg(ptr_adts_crc_info, it_bit_buff, CRC_ADTS_HEADER_LEN); - ixheaacd_find_syncword(adts, it_bit_buff); + err = ixheaacd_find_syncword(adts, it_bit_buff); + if (err) return err; tmp = ixheaacd_read_bits_buf(it_bit_buff, 10); @@ -545,7 +546,7 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct, ixheaacd_read_bits_buf(it_bit_buff, 5); } - if (aac_state_struct->ui_init_done) { + if (aac_state_struct->header_dec_done || aac_state_struct->ui_init_done) { if (aac_state_struct->audio_object_type != aot_init) return IA_FATAL_ERROR; } @@ -1003,10 +1004,12 @@ WORD32 ixheaacd_aac_headerdecode( (header_len - bytes_taken)) { ia_adts_header_struct adts_loc = {0}; - handle_bit_buff = ixheaacd_create_init_bit_buf( + ixheaacd_create_init_bit_buf( &it_bit_buff, (UWORD8 *)(buffer + adts.aac_frame_length), (WORD16)(header_len - bytes_taken - adts.aac_frame_length)); + handle_bit_buff = &it_bit_buff; + adts_loc.sync_word = (WORD16)ixheaacd_read_bits_buf(handle_bit_buff, 12); |