static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int ret, fsize;



    ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);

    if (ret < 0)

        return ret;

    if (ret < ADTS_HEADER_SIZE) {

        av_packet_unref(pkt);

        return AVERROR(EIO);

    }



    if ((AV_RB16(pkt->data) >> 4) != 0xfff) {

        av_packet_unref(pkt);

        return AVERROR_INVALIDDATA;

    }



    fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF;

    if (fsize < ADTS_HEADER_SIZE) {

        av_packet_unref(pkt);

        return AVERROR_INVALIDDATA;

    }



    return av_append_packet(s->pb, pkt, fsize - ADTS_HEADER_SIZE);

}

static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int ret, fsize;



    ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);

    if (ret < 0)

        return ret;

    if (ret < ADTS_HEADER_SIZE) {

        av_packet_unref(pkt);

        return AVERROR(EIO);

    }



    if ((AV_RB16(pkt->data) >> 4) != 0xfff) {

        av_packet_unref(pkt);

        return AVERROR_INVALIDDATA;

    }



    fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF;

    if (fsize < ADTS_HEADER_SIZE) {

        av_packet_unref(pkt);

        return AVERROR_INVALIDDATA;

    }



    return av_append_packet(s->pb, pkt, fsize - ADTS_HEADER_SIZE);

}

    return av_append_packet(s->pb, pkt, fsize - ADTS_HEADER_SIZE);
static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)

{

    int VAR_2, VAR_3;



    VAR_2 = av_get_packet(VAR_0->pb, VAR_1, ADTS_HEADER_SIZE);

    if (VAR_2 < 0)

        return VAR_2;

    if (VAR_2 < ADTS_HEADER_SIZE) {

        av_packet_unref(VAR_1);

        return AVERROR(EIO);

    }



    if ((AV_RB16(VAR_1->data) >> 4) != 0xfff) {

        av_packet_unref(VAR_1);

        return AVERROR_INVALIDDATA;

    }



    VAR_3 = (AV_RB32(VAR_1->data + 3) >> 13) & 0x1FFF;

    if (VAR_3 < ADTS_HEADER_SIZE) {

        av_packet_unref(VAR_1);

        return AVERROR_INVALIDDATA;

    }



    return av_append_packet(VAR_0->pb, VAR_1, VAR_3 - ADTS_HEADER_SIZE);

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{ int VAR_2, VAR_3; VAR_2 = av_get_packet(VAR_0->pb, VAR_1, ADTS_HEADER_SIZE); if (VAR_2 < 0)
return VAR_2; if (VAR_2 < ADTS_HEADER_SIZE) { av_packet_unref(VAR_1); return AVERROR(EIO); } if ((AV_RB16(VAR_1->data) >> 4) != 0xfff) { av_packet_unref(VAR_1); return AVERROR_INVALIDDATA; } VAR_3 = (AV_RB32(VAR_1->data + 3) >> 13) & 0x1FFF; if (VAR_3 < ADTS_HEADER_SIZE) { av_packet_unref(VAR_1); return AVERROR_INVALIDDATA; } return av_append_packet(VAR_0->pb, VAR_1, VAR_3 - ADTS_HEADER_SIZE); }