Commit ad7d8995 authored by vaclav's avatar vaclav
Browse files

fix "-fr 5" decoding

parent d74178ec
Loading
Loading
Loading
Loading
+8 −26
Original line number Diff line number Diff line
@@ -2348,7 +2348,6 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError: could not feed frame to decoder: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }

#ifdef MEM_ALLOC_APP_DEC
                /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
@@ -2362,6 +2361,7 @@ static ivas_error decodeG192(
                    goto cleanup;
                }
#endif
            }

#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
@@ -3236,24 +3236,6 @@ static ivas_error decodeVoIP(
            break;
        }

#ifdef MEM_ALLOC_APP_DEC
#if 0
#ifndef MEM_ALLOC_APP_DEC_JBM
        uint16_t nSamplesRendered = 0;
        /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, NULL ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
#endif
#endif
#endif

        /* decode and get samples */

#ifdef SPLIT_REND_WITH_HEAD_ROT
+13 −14
Original line number Diff line number Diff line
@@ -2712,20 +2712,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
                }
            }

#ifdef MEM_ALLOC_APP_DEC_JBM
            uint16_t nSamplesRendered2 = 0;
            /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, pcmBuf + nSamplesRendered2 * nOutChannels ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                return error;
            }
#endif

#ifdef SUPPORT_JBM_TRACEFILE
            /* jbmWriterFn and jbmWriter may be NULL if tracefile writing was not requested on CLI */
            if ( jbmWriterFn != NULL && jbmWriter != NULL )
@@ -2761,6 +2747,19 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
            }
        }

#ifdef MEM_ALLOC_APP_DEC_JBM
        uint16_t nSamplesRendered2 = 0;
        /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_Setup( hIvasDec, &nSamplesRendered2, pcmBuf + nSamplesRendered2 * nOutChannels ) ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "\nIVAS_DEC_Setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            return error;
        }
#endif
        /* decode */
        if ( !hIvasDec->hasBeenFedFirstGoodFrame )
        {