Commit 0c07e259 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

- correctly handle error return for refactored function calls

- change return type of ivas_rend_closeCrend to void
- replace references to "SPAR Crend" by just "Crend"
- minor formatting
parent 39d594ce
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5383,7 +5383,11 @@ ivas_error ivas_rend_initCrend(
    RENDER_CONFIG_DATA *hRendCfg,
    const int32_t output_Fs );

#ifdef FIX_197_CREND_INTERFACE
void ivas_rend_closeCrend(
#else
ivas_error ivas_rend_closeCrend(
#endif
    CREND_WRAPPER_HANDLE *pCrend );

ivas_error ivas_rend_crendProcess(
+24 −2
Original line number Diff line number Diff line
@@ -208,7 +208,18 @@ ivas_error ivas_dec(
            else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
            {
#ifdef FIX_197_CREND_INTERFACE
                ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_REND_AUDIO_CONFIG_7_1_4, IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM, st_ivas->hDecoderConfig, st_ivas->hHeadTrackData, &st_ivas->hIntSetup, NULL, output, output_Fs );
                if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper,
                                                       IVAS_REND_AUDIO_CONFIG_7_1_4,
                                                       IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM,
                                                       st_ivas->hDecoderConfig,
                                                       st_ivas->hHeadTrackData,
                                                       &st_ivas->hIntSetup,
                                                       NULL,
                                                       output,
                                                       output_Fs ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#else
                ivas_crend_process( st_ivas, output );
#endif
@@ -394,7 +405,18 @@ ivas_error ivas_dec(
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM )
            {
#ifdef FIX_197_CREND_INTERFACE
                ivas_rend_crendProcess( st_ivas->hCrendWrapper, getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ), st_ivas->hDecoderConfig, st_ivas->hHeadTrackData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, output, output_Fs );
                if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper,
                                                       getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ),
                                                       getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ),
                                                       st_ivas->hDecoderConfig,
                                                       st_ivas->hHeadTrackData,
                                                       &st_ivas->hIntSetup,
                                                       st_ivas->hEFAPdata,
                                                       output,
                                                       output_Fs ) != IVAS_ERR_OK ) )
                {
                    return error;
                }
#else
                ivas_crend_process( st_ivas, output );
#endif
+12 −4
Original line number Diff line number Diff line
@@ -1148,14 +1148,14 @@ ivas_error ivas_init_decoder(
#ifdef FIX_197_CREND_INTERFACE
            if ( ( st_ivas->hCrendWrapper = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL )
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend Wrapper\n" );
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" );
            }
            if ( ( st_ivas->hCrendWrapper->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL )
#else
            if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL )
#endif
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" );
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" );
            }
        }
    }
@@ -1178,12 +1178,20 @@ ivas_error ivas_init_decoder(
#ifdef FIX_197_CREND_INTERFACE
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && st_ivas->hDecoderConfig->Opt_Headrotation )
        {
            if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
            if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ),
                                           st_ivas->hIntSetup.ls_azimuth,
                                           st_ivas->hIntSetup.ls_elevation,
                                           st_ivas->hIntSetup.nchan_out_woLFE,
                                           EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
            {
                return error;
            }
        }
        if ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK )
        if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ),
                                            getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ),
                                            getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ),
                                            st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation,
                                            st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK ) )
        {
            return error;
        }
+9 −1
Original line number Diff line number Diff line
@@ -1086,7 +1086,15 @@ static ivas_error ivas_ism_bitrate_switching(

            /* Open Crend Binaural renderer */
#ifdef FIX_197_CREND_INTERFACE
            ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ), st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hDecoderConfig->output_Fs );
            if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ),
                                                getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ),
                                                getRendAudioConfigFromIvasAudioConfig( st_ivas->hOutSetup.output_config ),
                                                st_ivas->hRenderConfig,
                                                st_ivas->hDecoderConfig->Opt_Headrotation,
                                                st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            ivas_crend_open( st_ivas );
#endif
+18 −14
Original line number Diff line number Diff line
@@ -1097,11 +1097,11 @@ static ivas_error ivas_mc_dec_reconfig(
                {
                    if ( ( st_ivas->hCrendWrapper = (CREND_WRAPPER_HANDLE) malloc( sizeof( CREND_WRAPPER ) ) ) == NULL )
                    {
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend Wrapper\n" );
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Wrapper\n" );
                    }
                    if ( ( st_ivas->hCrendWrapper->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL )
                    {
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" );
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" );
                    }
                }
#else
@@ -1109,7 +1109,7 @@ static ivas_error ivas_mc_dec_reconfig(
                {
                    if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL )
                    {
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" );
                        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend\n" );
                    }
                }
#endif
@@ -1117,9 +1117,13 @@ static ivas_error ivas_mc_dec_reconfig(
#ifdef FIX_197_CREND_INTERFACE
            else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) )
            {
                if ( ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ), getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ), st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation, st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK )
                if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ),
                                                    getRendAudioConfigFromIvasAudioConfig( st_ivas->intern_config ),
                                                    getRendAudioConfigFromIvasAudioConfig( st_ivas->hDecoderConfig->output_config ),
                                                    st_ivas->hRenderConfig, st_ivas->hDecoderConfig->Opt_Headrotation,
                                                    st_ivas->hDecoderConfig->output_Fs ) != IVAS_ERR_OK ) )
                {
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "ivas_crend_open failed" );
                    return error;
                }
            }
#else
Loading