Repository: xbmc/xbmc
File: xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp (C++)

Code before:
    {AV_CODEC_ID_AAC, {"AAC"}},       {AV_CODEC_ID_AAC_LATM, {"AAC"}}};

const auto ms_hdrInfoMap = std::map<AVColorTransferCharacteristic, std::string_view>({
    {AVCOL_TRC_SMPTE2084, "HDR10"},
    {AVCOL_TRC_ARIB_STD_B67, "HLG"},
});

unsigned int SelectTranscodingSampleRate(const unsigned int sampleRate)
{
  switch (sampleRate)
  {
    case 11025:
    case 22050:
    case 44100:
    case 88200:
    case 176400:
    case 352800:
      return 44100;
    case 32000:
      return 32000;
    default:
      return 48000;
  }
}

static unsigned int ParseAACSampleRate(const uint8_t* data, size_t size)
{
  if (size < 2)
    return 0;

  // see ff_mpeg4audio_sample_rates
  static const unsigned int sampleRates[16] = {96000, 88200, 64000, 48000, 44100, 32000,
                                               24000, 22050, 16000, 12000, 11025, 8000,
                                               7350,  0,     0,     0};

  constexpr unsigned int AAC_AOT_AAC_LC = 2;
  constexpr unsigned int AAC_AOT_SBR = 5;
  constexpr unsigned int AAC_AOT_PS = 29;
  constexpr size_t MIN_SIZE_FOR_SBR = 5;
  constexpr unsigned int MAX_SAMPLE_INDEX = 15;

  // Read the Audio Object Type (AOT)
  unsigned int aot = (data[0] >> 3) & 0x1F;

  // Read the sampling_frequency_index
  unsigned int srIndex = ((data[0] & 0x07) << 1) | (data[1] >> 7);
  unsigned int sampleRate = (srIndex <= MAX_SAMPLE_INDEX) ? sampleRates[srIndex] : 0;

  // HE-AAC / HE-AACv2 (PS) check
  if ((aot == AAC_AOT_AAC_LC || aot == AAC_AOT_SBR || aot == AAC_AOT_PS) &&
      size >= MIN_SIZE_FOR_SBR)

Review comment (suggestion):
"static" not needed its already static

PS. ignore Claude its triggered at each change...it's quite spammy

Code after:
                                                          {AV_CODEC_ID_AAC_LATM, "AAC"}});

const auto ms_hdrInfoMap = std::map<AVColorTransferCharacteristic, std::string_view>({
    {AVCOL_TRC_SMPTE2084, "HDR10"},
    {AVCOL_TRC_ARIB_STD_B67, "HLG"},
});

unsigned int SelectTranscodingSampleRate(const unsigned int sampleRate)
{
  switch (sampleRate)
  {
    case 11025:
    case 22050:
    case 44100:
    case 88200:
    case 176400:
    case 352800:
      return 44100;
    case 32000:
      return 32000;
    default:
      return 48000;
  }
}

unsigned int ParseAACSampleRate(const uint8_t* data, const size_t size)
{
  if (size < 2)
    return 0;

  // see ff_mpeg4audio_sample_rates
  static const unsigned int sampleRates[16] = {96000, 88200, 64000, 48000, 44100, 32000,
                                               24000, 22050, 16000, 12000, 11025, 8000,
                                               7350,  0,     0,     0};

  constexpr unsigned int AAC_AOT_AAC_LC = 2;
  constexpr unsigned int AAC_AOT_SBR = 5;
  constexpr unsigned int AAC_AOT_PS = 29;
  constexpr size_t MIN_SIZE_FOR_SBR = 5;
  constexpr unsigned int MAX_SAMPLE_INDEX = 15;

  // Read the Audio Object Type (AOT)
  const unsigned int aot = (data[0] >> 3) & 0x1F;

  // Read the sampling_frequency_index
  const unsigned int srIndex = ((data[0] & 0x07) << 1) | (data[1] >> 7);
  unsigned int sampleRate = (srIndex <= MAX_SAMPLE_INDEX) ? sampleRates[srIndex] : 0;

  // HE-AAC / HE-AACv2 (PS) check
  if ((aot == AAC_AOT_AAC_LC || aot == AAC_AOT_SBR || aot == AAC_AOT_PS) &&
      size >= MIN_SIZE_FOR_SBR)