static int vqf_read_seek(AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    VqfContext *c = s->priv_data;

    AVStream *st;

    int ret;

    int64_t pos;



    st = s->streams[stream_index];

    pos = av_rescale_rnd(timestamp * st->codec->bit_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)c->frame_bit_len,

                         (flags & AVSEEK_FLAG_BACKWARD) ?

                                                   AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= c->frame_bit_len;



    st->cur_dts = av_rescale(pos, st->time_base.den,

                             st->codec->bit_rate * (int64_t)st->time_base.num);



    if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0)

        return ret;



    c->remaining_bits = -7 - ((pos-7)&7);

    return 0;

}

static int vqf_read_seek(AVFormatContext *s,

                         int stream_index, int64_t timestamp, int flags)

{

    VqfContext *c = s->priv_data;

    AVStream *st;

    int ret;

    int64_t pos;



    st = s->streams[stream_index];

    pos = av_rescale_rnd(timestamp * st->codec->bit_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)c->frame_bit_len,

                         (flags & AVSEEK_FLAG_BACKWARD) ?

                                                   AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= c->frame_bit_len;



    st->cur_dts = av_rescale(pos, st->time_base.den,

                             st->codec->bit_rate * (int64_t)st->time_base.num);



    if ((ret = avio_seek(s->pb, ((pos-7) >> 3) + s->internal->data_offset, SEEK_SET)) < 0)

        return ret;



    c->remaining_bits = -7 - ((pos-7)&7);

    return 0;

}

    int ret;
static int FUNC_0(AVFormatContext *VAR_0,

                         int VAR_1, int64_t VAR_2, int VAR_3)

{

    VqfContext *c = VAR_0->priv_data;

    AVStream *st;

    int VAR_4;

    int64_t pos;



    st = VAR_0->streams[VAR_1];

    pos = av_rescale_rnd(VAR_2 * st->codec->bit_rate,

                         st->time_base.num,

                         st->time_base.den * (int64_t)c->frame_bit_len,

                         (VAR_3 & AVSEEK_FLAG_BACKWARD) ?

                                                   AV_ROUND_DOWN : AV_ROUND_UP);

    pos *= c->frame_bit_len;



    st->cur_dts = av_rescale(pos, st->time_base.den,

                             st->codec->bit_rate * (int64_t)st->time_base.num);



    if ((VAR_4 = avio_seek(VAR_0->pb, ((pos-7) >> 3) + VAR_0->internal->data_offset, SEEK_SET)) < 0)

        return VAR_4;



    c->remaining_bits = -7 - ((pos-7)&7);

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0,
int VAR_1, int64_t VAR_2, int VAR_3)
{ VqfContext *c = VAR_0->priv_data; AVStream *st; int VAR_4; int64_t pos; st = VAR_0->streams[VAR_1]; pos = av_rescale_rnd(VAR_2 * st->codec->bit_rate,
st->time_base.num,
st->time_base.den * (int64_t)c->frame_bit_len,
(VAR_3 & AVSEEK_FLAG_BACKWARD) ?
AV_ROUND_DOWN : AV_ROUND_UP); pos *= c->frame_bit_len; st->cur_dts = av_rescale(pos, st->time_base.den,
st->codec->bit_rate * (int64_t)st->time_base.num); if ((VAR_4 = avio_seek(VAR_0->pb, ((pos-7) >> 3) + VAR_0->internal->data_offset, SEEK_SET)) < 0)
return VAR_4; c->remaining_bits = -7 - ((pos-7)&7); return 0; }