Commit bd921fad authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

use latencyNsToSamples in IVAS_REND_GetDelay() and initMcBinauralRendering()

parent b597b760
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2433,7 +2433,7 @@ static ivas_error initMcBinauralRendering(

    /* determine binaural delay ( used for aligning LFE to output signal ) */
    binauralDelayNs = max( ( inputMc->crendWrapper != NULL ) ? inputMc->crendWrapper->binaural_latency_ns : 0, inputMc->tdRendWrapper.binaural_latency_ns );
    inputMc->binauralDelaySmp = (int16_t) roundf( (float) binauralDelayNs * *inputMc->base.ctx.pOutSampleRate / 1000000000.f );
    inputMc->binauralDelaySmp = latencyNsToSamples( *inputMc->base.ctx.pOutSampleRate, binauralDelayNs );

    if ( inputMc->binauralDelaySmp > MAX_BIN_DELAY_SAMPLES )
    {
@@ -4250,7 +4250,7 @@ ivas_error IVAS_REND_GetDelay(

    max_latency_ns = getMaxGlobalDelayNs( hIvasRend );

    *nSamples = (int16_t) roundf( (float) max_latency_ns * *timeScale / 1000000000.f );
    *nSamples = latencyNsToSamples( hIvasRend->sampleRateOut, max_latency_ns );

    return IVAS_ERR_OK;
}