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

{

    OMAContext *oc  = s->priv_data;

    AVStream *st    = s->streams[0];

    int packet_size = st->codec->block_align;

    int byte_rate   = st->codec->bit_rate >> 3;

    int64_t pos     = avio_tell(s->pb);

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



    if (ret < packet_size)

        pkt->flags |= AV_PKT_FLAG_CORRUPT;



    if (ret < 0)

        return ret;

    if (!ret)

        return AVERROR_EOF;



    pkt->stream_index = 0;



    if (pos > 0) {

        pkt->pts =

        pkt->dts = av_rescale(pos, st->time_base.den,

                              byte_rate * (int64_t)st->time_base.num);

    }



    if (oc->encrypted) {

        /* previous unencrypted block saved in IV for

         * the next packet (CBC mode) */

        if (ret == packet_size)

            av_des_crypt(&oc->av_des, pkt->data, pkt->data,

                         (packet_size >> 3), oc->iv, 1);

        else

            memset(oc->iv, 0, 8);

    }



    return ret;

}

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

{

    OMAContext *oc  = s->priv_data;

    AVStream *st    = s->streams[0];

    int packet_size = st->codec->block_align;

    int byte_rate   = st->codec->bit_rate >> 3;

    int64_t pos     = avio_tell(s->pb);

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



    if (ret < packet_size)

        pkt->flags |= AV_PKT_FLAG_CORRUPT;



    if (ret < 0)

        return ret;

    if (!ret)

        return AVERROR_EOF;



    pkt->stream_index = 0;



    if (pos > 0) {

        pkt->pts =

        pkt->dts = av_rescale(pos, st->time_base.den,

                              byte_rate * (int64_t)st->time_base.num);

    }



    if (oc->encrypted) {

        



        if (ret == packet_size)

            av_des_crypt(&oc->av_des, pkt->data, pkt->data,

                         (packet_size >> 3), oc->iv, 1);

        else

            memset(oc->iv, 0, 8);

    }



    return ret;

}

    if (pos > 0) {
static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)

{

    OMAContext *oc  = VAR_0->priv_data;

    AVStream *st    = VAR_0->streams[0];

    int VAR_2 = st->codec->block_align;

    int VAR_3   = st->codec->bit_rate >> 3;

    int64_t pos     = avio_tell(VAR_0->pb);

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



    if (VAR_4 < VAR_2)

        VAR_1->flags |= AV_PKT_FLAG_CORRUPT;



    if (VAR_4 < 0)

        return VAR_4;

    if (!VAR_4)

        return AVERROR_EOF;



    VAR_1->stream_index = 0;



    if (pos > 0) {

        VAR_1->pts =

        VAR_1->dts = av_rescale(pos, st->time_base.den,

                              VAR_3 * (int64_t)st->time_base.num);

    }



    if (oc->encrypted) {

        



        if (VAR_4 == VAR_2)

            av_des_crypt(&oc->av_des, VAR_1->data, VAR_1->data,

                         (VAR_2 >> 3), oc->iv, 1);

        else

            memset(oc->iv, 0, 8);

    }



    return VAR_4;

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{ OMAContext *oc  = VAR_0->priv_data; AVStream *st    = VAR_0->streams[0]; int VAR_2 = st->codec->block_align; int VAR_3   = st->codec->bit_rate >> 3; int64_t pos     = avio_tell(VAR_0->pb); int VAR_4         = av_get_packet(VAR_0->pb, VAR_1, VAR_2); if (VAR_4 < VAR_2)
VAR_1->flags |= AV_PKT_FLAG_CORRUPT; if (VAR_4 < 0)
return VAR_4; if (!VAR_4)
return AVERROR_EOF; VAR_1->stream_index = 0; if (pos > 0) { VAR_1->pts =
VAR_1->dts = av_rescale(pos, st->time_base.den,
VAR_3 * (int64_t)st->time_base.num); } if (oc->encrypted) { if (VAR_4 == VAR_2)
av_des_crypt(&oc->av_des, VAR_1->data, VAR_1->data,
(VAR_2 >> 3), oc->iv, 1); else
memset(oc->iv, 0, 8); } return VAR_4; }