Commit 7b4a8cbe authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] crash for 0DOF with CODEC_DEFAULT

parent 7ecab34f
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1316,12 +1316,12 @@ ivas_error ivas_init_decoder(
             ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
            ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 0,
                                                  ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                                  st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );

            error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend,
                                              &st_ivas->hRenderConfig->split_rend_config,
                                              hDecoderConfig->output_Fs,
                                              1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                              1, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );

            if ( error != IVAS_ERR_OK )
            {
@@ -1367,7 +1367,7 @@ ivas_error ivas_init_decoder(
             ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
            ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 1,
                                                  ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                                  st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );

#ifdef SPLIT_REND_TD_POSE_CORRECTION
            if ( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB )
@@ -1390,7 +1390,7 @@ ivas_error ivas_init_decoder(
            error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend,
                                              &st_ivas->hRenderConfig->split_rend_config,
                                              hDecoderConfig->output_Fs, 0,
                                              ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                              st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );

            if ( error != IVAS_ERR_OK )
            {
@@ -1439,7 +1439,7 @@ ivas_error ivas_init_decoder(
             ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
            int16_t pcm_out;
            pcm_out = ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
            pcm_out = st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
            ivas_split_rend_choose_default_codec( &st_ivas->hRenderConfig->split_rend_config.codec, 1,
                                                  pcm_out );

+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ ivas_error ivas_sba_dec_reconfigure(
            assert( st_ivas->hRenderConfig->split_rend_config.codec == IVAS_SPLIT_REND_CODEC_LCLD );
            error = ivas_split_renderer_open( &st_ivas->splitBinRend.splitrend,
                                              &st_ivas->hRenderConfig->split_rend_config,
                                              hDecoderConfig->output_Fs, 1, ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                              hDecoderConfig->output_Fs, 1, st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
            if ( error != IVAS_ERR_OK )
            {
                return error;
+3 −1
Original line number Diff line number Diff line
@@ -2227,7 +2227,9 @@ ivas_error ivas_renderMultiBinToSplitBinaural(
    }
#endif

    /*TODO : why should this be called during run time ?*/
    /* Needs to be done at runtime. If this was in another API function,
     * there would be no guarantee that the user did not change
     * the split rendering config before calling the main rendering function */
    ivas_split_rend_choose_default_codec( &splitCodec, td_input, pcm_out );

    if ( td_input )
+10 −2
Original line number Diff line number Diff line
@@ -3455,7 +3455,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN
                                          pSplit_rend_config,
                                          outputSampleRate,
                                          0,
                                          ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 );
                                          outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
        if ( error != IVAS_ERR_OK )
        {
            return error;
@@ -4068,6 +4068,11 @@ ivas_error IVAS_REND_AddInput(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( hIvasRend->splitRendEncBuffer.data == NULL )
    {

        ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec,
                                              1,
                                              hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );

        if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK )
        {
            return error;
@@ -4941,8 +4946,11 @@ int16_t IVAS_REND_FeedRenderConfig(
        return error;
    }

    /* Must re-initialize split rendering config which depends on renderer config */ // TODO tmu2sgi need to check this block, could be a merge artifact (was removed in incoming)
    /* Must re-initialize split rendering config in case renderer config is updated after adding renderer inputs */
    closeSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer );
    ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec,
                                          1,
                                          hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM );
    if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, hIvasRend->headRotData, hIvasRend->sampleRateOut, hIvasRend->outputConfig ) ) != IVAS_ERR_OK )
    {
        return error;