Commit ff351d0a authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

do not call IVAS_DEC_GetRenderNumSubfr() twice

parent 08aa493c
Loading
Loading
Loading
Loading
Loading
+19 −22
Original line number Diff line number Diff line
@@ -417,22 +417,10 @@ int main(
        goto cleanup;
    }

    if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    if ( arg.render_num_subframes != asked_num_subframes )
    {
        fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for decoding to EXT!\n" );
    }

    /*------------------------------------------------------------------------------------------*
     * Configure Split rendering
     *------------------------------------------------------------------------------------------*/

    asked_num_subframes = arg.render_num_subframes;
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
@@ -440,6 +428,7 @@ int main(
            fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg.render_num_subframes ) ) != IVAS_ERR_OK )
    {
@@ -450,10 +439,9 @@ int main(
#ifdef FIX_1449_RENDERER_FRAME_SIZE_UNCLEAR_IN_ISAR
    if ( !arg.renderConfigEnabled && ( arg.render_num_subframes != asked_num_subframes ) )
    {
            fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for non-0dof split rendering!\n" );
        fprintf( stderr, "\nChanged render framesize, only 20ms allowed!\n" );
    }
#endif
    }

    /*------------------------------------------------------------------------------------------*
     * Configure VoIP mode
@@ -3942,6 +3930,15 @@ static ivas_error restartDecoder(
        goto cleanup;
    }

    if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
    }

    if ( ( error = IVAS_DEC_GetRenderNumSubfr( hIvasDec, &arg->render_num_subframes ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_GetRenderNumSubfr failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );