@@ -600,6 +600,7 @@ static int32_t iamf_stream_scale_decoder_demix(IAMF_StreamDecoder *decoder,
600600 uint32_t frame_size );
601601static int iamf_stream_ambisonics_decoder_decode (IAMF_StreamDecoder * decoder ,
602602 float * pcm );
603+ static uint32_t iamf_stream_ambisionisc_order (int channels );
603604
604605/* >>>>>>>>>>>>>>>>>> DATABASE >>>>>>>>>>>>>>>>>> */
605606
@@ -698,14 +699,13 @@ static int iamf_element_is_valid(IAMF_Element *e) {
698699 } else if (e -> element_type == AUDIO_ELEMENT_TYPE_SCENE_BASED ) {
699700 int channels = e -> ambisonics_conf -> substream_count +
700701 e -> ambisonics_conf -> coupled_substream_count ;
701- if ((e -> ambisonics_conf -> output_channel_count >
702- IAMF_AMBISONICS_MAX_CHANNELS ) ||
703- (channels > IAMF_AMBISONICS_MAX_CHANNELS )) {
702+ if ((iamf_stream_ambisionisc_order (
703+ e -> ambisonics_conf -> output_channel_count ) == UINT32_MAX ) ||
704+ (channels > e -> ambisonics_conf -> output_channel_count )) {
704705 ia_logw (
705- "Invalid output channel count %d or invalid channels %d in "
706- "ambisonics mode, it is more than %d" ,
707- e -> ambisonics_conf -> output_channel_count , channels ,
708- IAMF_AMBISONICS_MAX_CHANNELS );
706+ "Invalid output channel count %d or input channel count %d more than "
707+ "output in ambisonics mode" ,
708+ e -> ambisonics_conf -> output_channel_count , channels );
709709 ret = IAMF_ERR_UNIMPLEMENTED ;
710710 }
711711 } else
0 commit comments