Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5696a4ef authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Fix AAC DRC metadata being ignored

The decoder will bypass all DRC processing during decode unless
  any of the DRC parameters is set.
The fix consists in setting the DRC reference level to its
  default value when after the decoder is initialized.

Change-Id: Ibb8355ab8c3c65020c5eef0752957040f7316c2a
parent 7edbacf2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@

#define FILEREAD_MAX_LAYERS 2

#define DRC_DEFAULT_REF_LEVEL 108   /* 108*0.25dB = -27 dB below full scale (typical for movies) */

namespace android {

template<class T>
@@ -110,6 +112,9 @@ status_t SoftAAC2::initDecoder() {
        }
    }
    mIsFirst = true;
    // the decoder will bypass all DRC processing during decode unless any of the DRC parameters
    //  is set, so here we just reset the DRC reference level to its default value.
    aacDecoder_SetParam(mAACDecoder, AAC_DRC_REFERENCE_LEVEL, DRC_DEFAULT_REF_LEVEL);
    return status;
}