printf("NOPTS\n");
static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts){    ASFContext *asf = s->priv_data;    int64_t pos;    int64_t pos_min, pos_max, pts_min, pts_max, cur_pts, pos_limit;    if (stream_index == -1)        stream_index= av_find_default_stream_index(s);        if (asf->packet_size <= 0)        return -1;    pos_min = 0;    pts_min = asf_read_pts(s, &pos_min, stream_index);    if (pts_min == AV_NOPTS_VALUE) return -1;       pos_max = (url_filesize(url_fileno(&s->pb)) - 1 - s->data_offset) / asf->packet_size; //FIXME wrong    pts_max = pts_min + s->duration;    pos_limit= pos_max;    while (pos_min < pos_limit) {        int64_t start_pos;        assert(pos_limit <= pos_max);        // interpolate position (better than dichotomy)        pos = (int64_t)((double)(pos_limit - pos_min) *                        (double)(pts - pts_min) /                        (double)(pts_max - pts_min)) + pos_min;        pos/= asf->packet_size;        if(pos <= pos_min)            pos= pos_min + 1;        else if(pos > pos_limit)            pos= pos_limit;        start_pos= pos;        // read the next timestamp     	cur_pts = asf_read_pts(s, &pos, stream_index);            if (cur_pts == AV_NOPTS_VALUE) {            return -1;        } else if (pts < cur_pts) {            pos_limit = start_pos - 1;            pos_max = pos;            pts_max = cur_pts;        } else {            pos_min = pos;            pts_min = cur_pts;            /* check if we are lucky */            if (pts == cur_pts)                break;        }    }    pos = pos_min;    url_fseek(&s->pb, pos*asf->packet_size + s->data_offset, SEEK_SET);    asf_reset_header(s);    return 0;}