@@ -1203,9 +1203,14 @@ static int iamf_database_mix_presentation_is_valid(IAMF_DataBase *db,
12031203 int channels = 0 ;
12041204 ElementItem * pi = 0 ;
12051205
1206- if (mp -> num_sub_mixes < IAMF_MIX_PRESENTATION_MAX_SUBS ) return 0 ;
12071206 sub = mp -> sub_mixes ;
1208- if (sub -> nb_elements > _profile_limit [db -> profile ].max_elements ) return 0 ;
1207+ if (sub -> nb_elements > _profile_limit [db -> profile ].max_elements ) {
1208+ ia_logw ("Too many elements %" PRIu64
1209+ " (should be <= %u) in mix presentation %" PRIu64 " for profile %u" ,
1210+ sub -> nb_elements , _profile_limit [db -> profile ].max_elements ,
1211+ mp -> mix_presentation_id , db -> profile );
1212+ return 0 ;
1213+ }
12091214
12101215 for (int e = 0 ; e < sub -> nb_elements ; ++ e ) {
12111216 econf = & sub -> conf_s [e ];
@@ -3014,6 +3019,7 @@ uint32_t iamf_decoder_internal_read_descriptors_OBUs(IAMF_DecoderHandle handle,
30143019 }
30153020 }
30163021 } else {
3022+ handle -> ctx .flags |= IAMF_FLAG_FRAME_START ;
30173023 if (!(~handle -> ctx .flags & IAMF_FLAG_DESCRIPTORS ))
30183024 handle -> ctx .flags |= IAMF_FLAG_CONFIG ;
30193025 break ;
@@ -3128,7 +3134,7 @@ int32_t iamf_decoder_internal_add_descrptor_OBU(IAMF_DecoderHandle handle,
31283134 db = & handle -> ctx .db ;
31293135 obj = IAMF_object_new (obu , 0 );
31303136 if (!obj ) {
3131- ia_loge ("fail to new object for %s(%d)" , IAMF_OBU_type_string (obu -> type ),
3137+ ia_logw ("fail to new object for %s(%d)" , IAMF_OBU_type_string (obu -> type ),
31323138 obu -> type );
31333139 return IAMF_ERR_ALLOC_FAIL ;
31343140 }
@@ -3920,8 +3926,7 @@ IAMF_DecoderHandle IAMF_decoder_open(void) {
39203926 handle -> ctx .threshold_db = LIMITER_MaximumTruePeak ;
39213927 handle -> ctx .loudness = 1.0f ;
39223928 handle -> ctx .sampling_rate = OUTPUT_SAMPLERATE ;
3923- handle -> ctx .normalization_loudness =
3924- MAX_LIMITED_NORMALIZATION_LOUDNESS ;
3929+ handle -> ctx .normalization_loudness = MAX_LIMITED_NORMALIZATION_LOUDNESS ;
39253930 handle -> ctx .status = IAMF_DECODER_STATUS_INIT ;
39263931 handle -> ctx .mix_presentation_id = INVALID_ID ;
39273932 handle -> limiter = audio_effect_peak_limiter_create ();
@@ -4061,10 +4066,10 @@ int iamf_decoder_internal_configure(IAMF_DecoderHandle handle,
40614066 } else {
40624067 ret = IAMF_ERR_INTERNAL ;
40634068 if (ctx -> mix_presentation_id != INVALID_ID )
4064- ia_loge ("Fail to find the mix presentation %" PRId64 " obu." ,
4069+ ia_logw ("Fail to find the mix presentation %" PRId64 " obu." ,
40654070 ctx -> mix_presentation_id );
40664071 else
4067- ia_loge ("Fail to find the valid mix presentation obu, try again." );
4072+ ia_logw ("Fail to find the valid mix presentation obu, try again." );
40684073 }
40694074 }
40704075
@@ -4078,6 +4083,10 @@ int IAMF_decoder_configure(IAMF_DecoderHandle handle, const uint8_t *data,
40784083
40794084 if (rsize ) {
40804085 * rsize = rs ;
4086+ if ((ret != IAMF_OK && ret != IAMF_ERR_BUFFER_TOO_SMALL ) ||
4087+ (ret == IAMF_ERR_BUFFER_TOO_SMALL &&
4088+ (handle -> ctx .flags & IAMF_FLAG_FRAME_START )))
4089+ ia_loge ("fail to configure decoder." );
40814090 return ret ;
40824091 }
40834092
@@ -4090,6 +4099,8 @@ int IAMF_decoder_configure(IAMF_DecoderHandle handle, const uint8_t *data,
40904099 ret = iamf_decoder_internal_configure (handle , 0 , 0 , 0 );
40914100 }
40924101
4102+ if (ret != IAMF_OK ) ia_loge ("fail to configure decoder." );
4103+
40934104 return ret ;
40944105}
40954106
0 commit comments