static int decode_audio_specific_config(AACContext *ac,

                                        AVCodecContext *avctx,

                                        MPEG4AudioConfig *m4ac,

                                        const uint8_t *data, int bit_size,

                                        int sync_extension)

{

    GetBitContext gb;

    int i, ret;



    ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);

    for (i = 0; i < bit_size >> 3; i++)

        ff_dlog(avctx, "%02x ", data[i]);

    ff_dlog(avctx, "\n");



    if ((ret = init_get_bits(&gb, data, bit_size)) < 0)

        return ret;



    if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,

                                          sync_extension)) < 0)

        return AVERROR_INVALIDDATA;

    if (m4ac->sampling_index > 12) {

        av_log(avctx, AV_LOG_ERROR,

               "invalid sampling rate index %d\n",

               m4ac->sampling_index);

        return AVERROR_INVALIDDATA;

    }

    if (m4ac->object_type == AOT_ER_AAC_LD &&

        (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {

        av_log(avctx, AV_LOG_ERROR,

               "invalid low delay sampling rate index %d\n",

               m4ac->sampling_index);

        return AVERROR_INVALIDDATA;

    }



    skip_bits_long(&gb, i);



    switch (m4ac->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

    case AOT_ER_AAC_LC:

    case AOT_ER_AAC_LD:

        if ((ret = decode_ga_specific_config(ac, avctx, &gb,

                                            m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    case AOT_ER_AAC_ELD:

        if ((ret = decode_eld_specific_config(ac, avctx, &gb,

                                              m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    default:

        avpriv_report_missing_feature(avctx,

                                      "Audio object type %s%d",

                                      m4ac->sbr == 1 ? "SBR+" : "",

                                      m4ac->object_type);

        return AVERROR(ENOSYS);

    }



    ff_dlog(avctx,

            "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",

            m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,

            m4ac->sample_rate, m4ac->sbr,

            m4ac->ps);



    return get_bits_count(&gb);

}

static int decode_audio_specific_config(AACContext *ac,

                                        AVCodecContext *avctx,

                                        MPEG4AudioConfig *m4ac,

                                        const uint8_t *data, int bit_size,

                                        int sync_extension)

{

    GetBitContext gb;

    int i, ret;



    ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);

    for (i = 0; i < bit_size >> 3; i++)

        ff_dlog(avctx, "%02x ", data[i]);

    ff_dlog(avctx, "\n");



    if ((ret = init_get_bits(&gb, data, bit_size)) < 0)

        return ret;



    if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size,

                                          sync_extension)) < 0)

        return AVERROR_INVALIDDATA;

    if (m4ac->sampling_index > 12) {

        av_log(avctx, AV_LOG_ERROR,

               "invalid sampling rate index %d\n",

               m4ac->sampling_index);

        return AVERROR_INVALIDDATA;

    }

    if (m4ac->object_type == AOT_ER_AAC_LD &&

        (m4ac->sampling_index < 3 || m4ac->sampling_index > 7)) {

        av_log(avctx, AV_LOG_ERROR,

               "invalid low delay sampling rate index %d\n",

               m4ac->sampling_index);

        return AVERROR_INVALIDDATA;

    }



    skip_bits_long(&gb, i);



    switch (m4ac->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

    case AOT_ER_AAC_LC:

    case AOT_ER_AAC_LD:

        if ((ret = decode_ga_specific_config(ac, avctx, &gb,

                                            m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    case AOT_ER_AAC_ELD:

        if ((ret = decode_eld_specific_config(ac, avctx, &gb,

                                              m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    default:

        avpriv_report_missing_feature(avctx,

                                      "Audio object type %s%d",

                                      m4ac->sbr == 1 ? "SBR+" : "",

                                      m4ac->object_type);

        return AVERROR(ENOSYS);

    }



    ff_dlog(avctx,

            "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",

            m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,

            m4ac->sample_rate, m4ac->sbr,

            m4ac->ps);



    return get_bits_count(&gb);

}

                                        const uint8_t *data, int bit_size,     ff_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
static int FUNC_0(AACContext *VAR_0,

                                        AVCodecContext *VAR_1,

                                        MPEG4AudioConfig *VAR_2,

                                        const uint8_t *VAR_3, int VAR_4,

                                        int VAR_5)

{

    GetBitContext gb;

    int VAR_6, VAR_7;



    ff_dlog(VAR_1, "audio specific config size %d\n", VAR_4 >> 3);

    for (VAR_6 = 0; VAR_6 < VAR_4 >> 3; VAR_6++)

        ff_dlog(VAR_1, "%02x ", VAR_3[VAR_6]);

    ff_dlog(VAR_1, "\n");



    if ((VAR_7 = init_get_bits(&gb, VAR_3, VAR_4)) < 0)

        return VAR_7;



    if ((VAR_6 = avpriv_mpeg4audio_get_config(VAR_2, VAR_3, VAR_4,

                                          VAR_5)) < 0)

        return AVERROR_INVALIDDATA;

    if (VAR_2->sampling_index > 12) {

        av_log(VAR_1, AV_LOG_ERROR,

               "invalid sampling rate index %d\n",

               VAR_2->sampling_index);

        return AVERROR_INVALIDDATA;

    }

    if (VAR_2->object_type == AOT_ER_AAC_LD &&

        (VAR_2->sampling_index < 3 || VAR_2->sampling_index > 7)) {

        av_log(VAR_1, AV_LOG_ERROR,

               "invalid low delay sampling rate index %d\n",

               VAR_2->sampling_index);

        return AVERROR_INVALIDDATA;

    }



    skip_bits_long(&gb, VAR_6);



    switch (VAR_2->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

    case AOT_ER_AAC_LC:

    case AOT_ER_AAC_LD:

        if ((VAR_7 = decode_ga_specific_config(VAR_0, VAR_1, &gb,

                                            VAR_2, VAR_2->chan_config)) < 0)

            return VAR_7;

        break;

    case AOT_ER_AAC_ELD:

        if ((VAR_7 = decode_eld_specific_config(VAR_0, VAR_1, &gb,

                                              VAR_2, VAR_2->chan_config)) < 0)

            return VAR_7;

        break;

    default:

        avpriv_report_missing_feature(VAR_1,

                                      "Audio object type %s%d",

                                      VAR_2->sbr == 1 ? "SBR+" : "",

                                      VAR_2->object_type);

        return AVERROR(ENOSYS);

    }



    ff_dlog(VAR_1,

            "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",

            VAR_2->object_type, VAR_2->chan_config, VAR_2->sampling_index,

            VAR_2->sample_rate, VAR_2->sbr,

            VAR_2->ps);



    return get_bits_count(&gb);

}

static int FUNC_0(AACContext *VAR_0,
AVCodecContext *VAR_1,
MPEG4AudioConfig *VAR_2,
const uint8_t *VAR_3, int VAR_4,
int VAR_5)
{ GetBitContext gb; int VAR_6, VAR_7; ff_dlog(VAR_1, "audio specific config size %d\n", VAR_4 >> 3); for (VAR_6 = 0; VAR_6 < VAR_4 >> 3; VAR_6++) ff_dlog(VAR_1, "%02x ", VAR_3[VAR_6]); ff_dlog(VAR_1, "\n"); if ((VAR_7 = init_get_bits(&gb, VAR_3, VAR_4)) < 0)
return VAR_7; if ((VAR_6 = avpriv_mpeg4audio_get_config(VAR_2, VAR_3, VAR_4,
VAR_5)) < 0)
return AVERROR_INVALIDDATA; if (VAR_2->sampling_index > 12) { av_log(VAR_1, AV_LOG_ERROR,
"invalid sampling rate index %d\n",
VAR_2->sampling_index); return AVERROR_INVALIDDATA; } if (VAR_2->object_type == AOT_ER_AAC_LD &&
(VAR_2->sampling_index < 3 || VAR_2->sampling_index > 7)) { av_log(VAR_1, AV_LOG_ERROR,
"invalid low delay sampling rate index %d\n",
VAR_2->sampling_index); return AVERROR_INVALIDDATA; } skip_bits_long(&gb, VAR_6); switch (VAR_2->object_type) { case AOT_AAC_MAIN:
case AOT_AAC_LC:
case AOT_AAC_LTP:
case AOT_ER_AAC_LC:
case AOT_ER_AAC_LD:
if ((VAR_7 = decode_ga_specific_config(VAR_0, VAR_1, &gb,
VAR_2, VAR_2->chan_config)) < 0)
return VAR_7; break; case AOT_ER_AAC_ELD:
if ((VAR_7 = decode_eld_specific_config(VAR_0, VAR_1, &gb,
VAR_2, VAR_2->chan_config)) < 0)
return VAR_7; break; default:
avpriv_report_missing_feature(VAR_1,
"Audio object type %s%d",
VAR_2->sbr == 1 ? "SBR+" : "",
VAR_2->object_type); return AVERROR(ENOSYS); } ff_dlog(VAR_1,
"AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
VAR_2->object_type, VAR_2->chan_config, VAR_2->sampling_index,
VAR_2->sample_rate, VAR_2->sbr,
VAR_2->ps); return get_bits_count(&gb); }