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;



    av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);

    for (i = 0; i < avctx->extradata_size; i++)

        av_dlog(avctx, "%02x ", avctx->extradata[i]);

    av_dlog(avctx, "\n");



    init_get_bits(&gb, data, bit_size);



    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;

    }



    skip_bits_long(&gb, i);



    switch (m4ac->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

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

                                            m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    default:

        av_log(avctx, AV_LOG_ERROR,

               "Audio object type %s%d is not supported.\n",

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

               m4ac->object_type);

        return AVERROR(ENOSYS);

    }



    av_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;



    av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);

    for (i = 0; i < avctx->extradata_size; i++)

        av_dlog(avctx, "%02x ", avctx->extradata[i]);

    av_dlog(avctx, "\n");



    init_get_bits(&gb, data, bit_size);



    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;

    }



    skip_bits_long(&gb, i);



    switch (m4ac->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

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

                                            m4ac, m4ac->chan_config)) < 0)

            return ret;

        break;

    default:

        av_log(avctx, AV_LOG_ERROR,

               "Audio object type %s%d is not supported.\n",

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

               m4ac->object_type);

        return AVERROR(ENOSYS);

    }



    av_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 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;



    av_dlog(VAR_1, "extradata size %d\n", VAR_1->extradata_size);

    for (VAR_6 = 0; VAR_6 < VAR_1->extradata_size; VAR_6++)

        av_dlog(VAR_1, "%02x ", VAR_1->extradata[VAR_6]);

    av_dlog(VAR_1, "\n");



    init_get_bits(&gb, VAR_3, VAR_4);



    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;

    }



    skip_bits_long(&gb, VAR_6);



    switch (VAR_2->object_type) {

    case AOT_AAC_MAIN:

    case AOT_AAC_LC:

    case AOT_AAC_LTP:

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

                                            VAR_2, VAR_2->chan_config)) < 0)

            return VAR_7;

        break;

    default:

        av_log(VAR_1, AV_LOG_ERROR,

               "Audio object type %s%d is not supported.\n",

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

               VAR_2->object_type);

        return AVERROR(ENOSYS);

    }



    av_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; av_dlog(VAR_1, "extradata size %d\n", VAR_1->extradata_size); for (VAR_6 = 0; VAR_6 < VAR_1->extradata_size; VAR_6++) av_dlog(VAR_1, "%02x ", VAR_1->extradata[VAR_6]); av_dlog(VAR_1, "\n"); init_get_bits(&gb, VAR_3, VAR_4); 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; } skip_bits_long(&gb, VAR_6); switch (VAR_2->object_type) { case AOT_AAC_MAIN:
case AOT_AAC_LC:
case AOT_AAC_LTP:
if ((VAR_7 = decode_ga_specific_config(VAR_0, VAR_1, &gb,
VAR_2, VAR_2->chan_config)) < 0)
return VAR_7; break; default:
av_log(VAR_1, AV_LOG_ERROR,
"Audio object type %s%d is not supported.\n",
VAR_2->sbr == 1 ? "SBR+" : "",
VAR_2->object_type); return AVERROR(ENOSYS); } av_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); }