Commit 2565d886 authored by Malenovsky, Vladimir's avatar Malenovsky, Vladimir
Browse files

do not call IVAS_DEC_GetRenderNumSubfr() twice

parent 44627aea
Loading
Loading
Loading
Loading
Loading
+19 −36
Original line number Diff line number Diff line
@@ -459,17 +459,6 @@ 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
     *------------------------------------------------------------------------------------------*/
@@ -482,6 +471,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 )
    {
@@ -492,10 +482,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
@@ -4396,6 +4385,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 ) );
@@ -4417,21 +4415,6 @@ 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 ) );
            goto cleanup;
        }
    }

    /* ISAR frame size is set from command line, not renderer config file.
     * This will be ignored if output format is not split rendering. */
    if ( renderConfig != NULL )