if (flags & AVSEEK_FLAG_BACKWARD) { frame_number = av_rescale_rnd(timestamp, sys->frame_rate, (int64_t) 30000 * sys->frame_rate_base, AV_ROUND_DOWN); } else { frame_number = av_rescale_rnd(timestamp, sys->frame_rate, (int64_t) 30000 * sys->frame_rate_base, AV_ROUND_UP); }  offset = sys->frame_size * frame_number;
offset = sys->frame_size * timestamp;
static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,                              int64_t timestamp, int flags){    // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)    const DVprofile* sys = dv_codec_profile(&c->vst->codec);    int64_t frame_number, offset;    int64_t size = url_filesize(url_fileno(&s->pb));    int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;    if (flags & AVSEEK_FLAG_BACKWARD) {       frame_number = av_rescale_rnd(timestamp, sys->frame_rate,                                     (int64_t) 30000 * sys->frame_rate_base,                                     AV_ROUND_DOWN);    }    else {       frame_number = av_rescale_rnd(timestamp, sys->frame_rate,                                     (int64_t) 30000 * sys->frame_rate_base,                                     AV_ROUND_UP);    }      offset = sys->frame_size * frame_number;        if (offset > max_offset) offset = max_offset;    else if (offset < 0) offset = 0;    return offset;}