sys = dv_codec_profile(&c->vst->codec);   frame_number = (timestamp * sys->frame_rate) / ((int64_t) 30000 * sys->frame_rate_base);   offset = (int64_t) sys->frame_size * frame_number;
if (offset > max_offset) offset = max_offset; else if (offset < 0) offset = 0;
int64_t dv_frame_offset(DVDemuxContext *c, int64_t timestamp){    const DVprofile* sys;    int64_t frame_number, offset;        // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)    sys = dv_codec_profile(&c->vst->codec);    // timestamp was scaled by time_base/AV_BASE_RATE by av_seek_frame()    frame_number = (timestamp * sys->frame_rate) /                    ((int64_t) 30000 * sys->frame_rate_base);    // offset must be a multiple of frame_size else dv_read_packet() will fail    offset = (int64_t) sys->frame_size * frame_number;    return offset;}