static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size)

{

    GetBitContext gb;



    init_get_bits(&gb, buf, size * 8);

    adts->objecttype = get_bits(&gb, 5) - 1;

    adts->sample_rate_index = get_bits(&gb, 4);

    adts->channel_conf = get_bits(&gb, 4);



    if (adts->objecttype > 3) {

        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype);

        return -1;

    }

    if (adts->sample_rate_index == 15) {

        av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n");

        return -1;

    }

    if (adts->channel_conf == 0) {

        ff_log_missing_feature(s, "PCE based channel configuration", 0);

        return -1;

    }



    adts->write_adts = 1;



    return 0;

}

static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, int size)

{

    GetBitContext gb;



    init_get_bits(&gb, buf, size * 8);

    adts->objecttype = get_bits(&gb, 5) - 1;

    adts->sample_rate_index = get_bits(&gb, 4);

    adts->channel_conf = get_bits(&gb, 4);



    if (adts->objecttype > 3) {

        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype);

        return -1;

    }

    if (adts->sample_rate_index == 15) {

        av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n");

        return -1;

    }

    if (adts->channel_conf == 0) {

        ff_log_missing_feature(s, "PCE based channel configuration", 0);

        return -1;

    }



    adts->write_adts = 1;



    return 0;

}

        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype);
static int FUNC_0(AVFormatContext *VAR_0, ADTSContext *VAR_1, uint8_t *VAR_2, int VAR_3)

{

    GetBitContext gb;



    init_get_bits(&gb, VAR_2, VAR_3 * 8);

    VAR_1->objecttype = get_bits(&gb, 5) - 1;

    VAR_1->sample_rate_index = get_bits(&gb, 4);

    VAR_1->channel_conf = get_bits(&gb, 4);



    if (VAR_1->objecttype > 3) {

        av_log(VAR_0, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", VAR_1->objecttype);

        return -1;

    }

    if (VAR_1->sample_rate_index == 15) {

        av_log(VAR_0, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n");

        return -1;

    }

    if (VAR_1->channel_conf == 0) {

        ff_log_missing_feature(VAR_0, "PCE based channel configuration", 0);

        return -1;

    }



    VAR_1->write_adts = 1;



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, ADTSContext *VAR_1, uint8_t *VAR_2, int VAR_3)
{ GetBitContext gb; init_get_bits(&gb, VAR_2, VAR_3 * 8); VAR_1->objecttype = get_bits(&gb, 5) - 1; VAR_1->sample_rate_index = get_bits(&gb, 4); VAR_1->channel_conf = get_bits(&gb, 4); if (VAR_1->objecttype > 3) { av_log(VAR_0, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", VAR_1->objecttype); return -1; } if (VAR_1->sample_rate_index == 15) { av_log(VAR_0, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n"); return -1; } if (VAR_1->channel_conf == 0) { ff_log_missing_feature(VAR_0, "PCE based channel configuration", 0); return -1; } VAR_1->write_adts = 1; return 0; }