do{
for(;;){
static int64_t asf_read_pts(AVFormatContext *s, int64_t *ppos, int stream_index){    ASFContext *asf = s->priv_data;    AVPacket pkt1, *pkt = &pkt1;    ASFStream *asf_st;    int64_t pts;    int64_t pos= *ppos;//printf("asf_read_pts\n");    url_fseek(&s->pb, pos*asf->packet_size + s->data_offset, SEEK_SET);    asf_reset_header(s);    do{        if (av_read_frame(s, pkt) < 0){            printf("seek failed\n");    	    return AV_NOPTS_VALUE;        }        pts= pkt->pts;        av_free_packet(pkt);    }while(pkt->stream_index != stream_index || !(pkt->flags&PKT_FLAG_KEY));    asf_st= s->streams[stream_index]->priv_data;    assert((asf_st->packet_pos - s->data_offset) % asf->packet_size == 0);    *ppos= (asf_st->packet_pos - s->data_offset) / asf->packet_size;//printf("found keyframe at %Ld stream %d stamp:%Ld\n", *ppos, stream_index, pts);    return pts;}