Commit c868709c authored by Jouni Paulus's avatar Jouni Paulus
Browse files

issue 371: when delay compensation is disabled, the reporting print-out has a...

issue 371: when delay compensation is disabled, the reporting print-out has a division-by-zero since a required variable is not properly assigned
parent 01c1860e
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1181,6 +1181,21 @@ static ivas_error initOnFirstGoodFrame(
    ivas_error error = IVAS_ERR_UNKNOWN;

    /* Now delay, number of output channels and frame size are known */
#ifdef FIX_371_DELAY_REPORT
    if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
        return error;
    }
    if ( !arg.delayCompensationEnabled )
    {
#ifdef BINAURALIZATION_DELAY_REPORT
        pFullDelayNumSamples[0] = 0;
#else
        *pFullDelayNumSamples = 0;
#endif
    }
#else
    if ( arg.delayCompensationEnabled )
    {
        if ( ( error = IVAS_DEC_GetDelay( hIvasDec, pFullDelayNumSamples, delayTimeScale ) ) != IVAS_ERR_OK )
@@ -1197,6 +1212,7 @@ static ivas_error initOnFirstGoodFrame(
        *pFullDelayNumSamples = 0;
#endif
    }
#endif
#ifdef BINAURALIZATION_DELAY_REPORT
    *pRemainingDelayNumSamples = pFullDelayNumSamples[0];
#else
+1 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@
#define ISM_HIGHEST_BITRATE                             /* VA: Issue 284: Update highest bitrate limit in ISM format */
#define TUNE_360_OBJECT_WITH_NOISE                      /* VA: issue 360: consider objects being speech+noise for active speech coding */
#define FIX_350_MASA_DELAY_COMP                         /* Nokia: Issue 350: MASA audio/meta delay compensation */
#define FIX_371_DELAY_REPORT                            /* Issue 371: div. by zero with -no_delay_cmp */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */