Commit 017163c3 authored by multrus's avatar multrus
Browse files

port of patch

parent 31d543d1
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP               /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */
#define FIX_1052_EXT_OUTPUT                             /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ 
#define NONBE_1215_FIX_JBM_MAX_SCALING                  /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */

#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ 

+16 −0
Original line number Diff line number Diff line
@@ -807,7 +807,15 @@ static void JB4_adaptActivePlayout(
                           ( dropRateMax - dropRateMin ) / dropGapMax +
                       dropRateMin;
                *scale = ( 1000 - rate ) / 10;
#ifdef NONBE_1215_FIX_JBM_MAX_SCALING
                /* Limit max scaling to the duration of one frame. APA will not exceed this limit
                 * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting
                 * the value to a sensible range here avoids integer overflows at later stages when
                 * converting maxScaling from milliseconds to samples. */
                *maxScaling = JB4_MIN( currPlayoutDelay - targetMax, 1000 / IVAS_NUM_FRAMES_PER_SEC );
#else
                *maxScaling = currPlayoutDelay - targetMax;
#endif
            }
        }
    }
@@ -823,7 +831,15 @@ static void JB4_adaptActivePlayout(
             currPlayoutDelay < targetMaxStretch && currPlayoutDelay < (uint32_t) ( 110 + h->rfDelay / 4 ) )
        {
            *scale = 120;
#ifdef NONBE_1215_FIX_JBM_MAX_SCALING
            /* Limit max scaling to the duration of one frame. APA will not exceed this limit
             * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting
             * the value to a sensible range here avoids integer overflows at later stages when
             * converting maxScaling from milliseconds to samples. */
            *maxScaling = JB4_MIN( targetMaxStretch - currPlayoutDelay, 1000 / IVAS_NUM_FRAMES_PER_SEC );
#else
            *maxScaling = targetMaxStretch - currPlayoutDelay;
#endif
        }
    }