Commit fcbc1c12 authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

Repair compilation without #FIX_I109

parent f96fbfd5
Loading
Loading
Loading
Loading
+30 −6
Original line number Diff line number Diff line
@@ -901,16 +901,28 @@ int main(
#ifdef FIX_I109_ORIENTATION_TRACKING
            for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; i++ )
            {
                HeadRotationFileReading( headRotReader, &quatBuffer[i] );
                if ( HeadRotationFileReading( headRotReader, &quatBuffer[i] ) != IVAS_ERR_OK )
                {
                    fprintf(stderr, "Error in Head Rotation File Reading.\r\n");
                    exit(-1);
                }
            }
#else
            HeadRotationFileReading( headRotReader, quatBuffer, frame );
#endif
            IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer );
            if ( IVAS_REND_SetHeadRotation( hIvasRend, quatBuffer ) != IVAS_ERR_OK )
            {
                    fprintf(stderr, "Error setting Head Rotation.\r\n");
                    exit(-1);
            }
        }
        else
        {
            IVAS_REND_SetHeadRotation( hIvasRend, NULL );
            if ( IVAS_REND_SetHeadRotation( hIvasRend, NULL ) != IVAS_ERR_OK )
            {
                    fprintf(stderr, "Error setting Head Rotation.\r\n");
                    exit(-1);
            }
        }

#ifdef FIX_I109_ORIENTATION_TRACKING
@@ -918,8 +930,16 @@ int main(
        if ( referenceRotReader != NULL )
        {
            IVAS_QUATERNION quaternion;
            HeadRotationFileReading( referenceRotReader, &quaternion );
            IVAS_REND_SetReferenceRotation( hIvasRend, quaternion );
            if ( HeadRotationFileReading( referenceRotReader, &quaternion ) != IVAS_ERR_OK )
            {
                    fprintf(stderr, "Error in Head Rotation File Reading.\r\n");
                    exit(-1);
            }
            if ( IVAS_REND_SetReferenceRotation( hIvasRend, quaternion ) != IVAS_ERR_OK )
            {
                    fprintf(stderr, "Error setting Reference Rotation.\r\n");
                    exit(-1);
            }
        }
#endif

@@ -1000,7 +1020,11 @@ int main(
            }
        }

        IVAS_REND_GetSamples( hIvasRend, outBuffer );
        if ( IVAS_REND_GetSamples( hIvasRend, outBuffer ) != IVAS_ERR_OK )
        {
            fprintf(stderr, "Error in getting samples\n");
            exit( -1 );
        }

        int16_t num_out_channels;
        num_out_channels = outBuffer.config.numChannels;
+0 −36
Original line number Diff line number Diff line
@@ -203,39 +203,3 @@ void ivas_HRTF_parambin_binary_close(
    return;
}

#ifndef FIX_I109_ORIENTATION_TRACKING
/*-----------------------------------------------------------------------*
 * ivas_headTrack_open()
 *
 * Allocate and initialize Head-Tracking handle
 *-----------------------------------------------------------------------*/

ivas_error ivas_headTrack_open(
    HEAD_TRACK_DATA_HANDLE *hHeadTrackData /* o  : head track handle    */
)
{
    int16_t i;

    /* Allocate Head-Tracking handle */
    if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL )
    {
        return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) );
    }

    /* Initialization */
    ( *hHeadTrackData )->num_quaternions = 0;
    ( *hHeadTrackData )->lrSwitchInterpVal = 0.0f;
    ( *hHeadTrackData )->lrSwitchedCurrent = 0;
    ( *hHeadTrackData )->lrSwitchedNext = 0;

    /* Initialise Rmat_prev to I, Rmat will be computed later */
    for ( i = 0; i < 3; i++ )
    {
        set_zero( ( *hHeadTrackData )->Rmat_prev[i], 3 );
        ( *hHeadTrackData )->Rmat_prev[i][i] = 1.0f;
    }

    return IVAS_ERR_OK;
}
#endif
+0 −30
Original line number Diff line number Diff line
@@ -410,36 +410,6 @@ typedef struct ivas_reverb_state_t

} REVERB_DATA, *REVERB_HANDLE;

#ifndef FIX_I109_ORIENTATION_TRACKING

typedef struct ivas_orient_trk_state_t
{
    OTR_TRACKING_T trackingType;
    float centerAdaptationRate;
    float offCenterAdaptationRate;
    float adaptationAngle;

    float alpha;

    float absYaw; /* absolute orientation */
    float absPitch;
    float absRoll;

    float absAvgYaw; /* average absolute orientation */
    float absAvgPitch;
    float absAvgRoll;

    float refYaw; /* reference orientation */
    float refPitch;
    float refRoll;

    float trkYaw; /* tracked orientation */
    float trkPitch;
    float trkRoll;

} ivas_orient_trk_state_t;
#endif


/*----------------------------------------------------------------------------------*
 * TD ISm Object Renderer structure