diff options
-rw-r--r-- | libAACdec/src/aacdecoder.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index 414c3e2..08128c0 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -1791,9 +1791,17 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc, downscaleFactorInBS = asc->m_samplingFrequency / asc->m_sc.m_eldSpecificConfig.m_downscaledSamplingFrequency; - if (downscaleFactorInBS == 1 || downscaleFactorInBS == 2 || - downscaleFactorInBS == 3 || downscaleFactorInBS == 4) { + if ((downscaleFactorInBS == 1 || downscaleFactorInBS == 2 || + (downscaleFactorInBS == 3 && + asc->m_sc.m_eldSpecificConfig.m_frameLengthFlag) || + downscaleFactorInBS == 4) && + ((asc->m_samplingFrequency % + asc->m_sc.m_eldSpecificConfig.m_downscaledSamplingFrequency) == + 0)) { downscaleFactor = downscaleFactorInBS; + } else { + downscaleFactorInBS = 1; + downscaleFactor = 1; } } } else { |