Commit 6b67e68e authored by bayers's avatar bayers
Browse files

add sanity check for EXT output, only allow 20ms render frame size, change it with a warning

parent 3d1c900b
Loading
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -202,6 +202,9 @@ int main(
    Vector3PairFileReader *referenceVectorReader = NULL;
    RenderConfigReader *renderConfigReader = NULL;
    int16_t *pcmBuf = NULL;
#ifdef NONBE_UNIFIED_DECODING_PATHS
    IVAS_RENDER_FRAMESIZE asked_frame_size;
#endif
#ifdef DEBUGGING
    int32_t noClipping;
    int32_t cnt_frames_limited;
@@ -438,6 +441,7 @@ int main(
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking,
                                       arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    asked_frame_size = arg.renderFramesize;
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
@@ -446,6 +450,18 @@ int main(
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
#ifdef NONBE_UNIFIED_DECODING_PATHS
    if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

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

    /*------------------------------------------------------------------------------------------*
     * Configure Split rendering
@@ -455,7 +471,7 @@ int main(
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef NONBE_UNIFIED_DECODING_PATHS
        IVAS_RENDER_FRAMESIZE asked_frame_size = arg.renderFramesize;
        asked_frame_size = arg.renderFramesize;
#endif
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
+8 −1
Original line number Diff line number Diff line
@@ -457,7 +457,14 @@ ivas_error IVAS_DEC_Configure(
    {
        return IVAS_ERR_WRONG_PARAMS;
    }
    if ( outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
        hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
    }
    else
    {
        hDecoderConfig->render_framesize = renderFramesize;
    }
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT