static int decode_syncpoint(NUTContext *nut){

    AVFormatContext *s= nut->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end;

    uint64_t tmp;

    int i;

    AVRational time_base;



    nut->last_syncpoint_pos= url_ftell(bc)-8;



    end= get_packetheader(nut, bc, 1);

    end += url_ftell(bc) - 4;



    tmp= get_v(bc);

    get_v(bc); //back_ptr_div16



    time_base= nut->time_base[tmp % nut->time_base_count];

    for(i=0; i<s->nb_streams; i++){

        nut->stream[i].last_pts= av_rescale_rnd(

            tmp / nut->time_base_count,

            time_base.num * (int64_t)nut->stream[i].time_base.den,

            time_base.den * (int64_t)nut->stream[i].time_base.num,

            AV_ROUND_DOWN);

        //last_key_frame ?

    }

    //FIXME put this in a reset func maybe



    if(skip_reserved(bc, end) || check_checksum(bc)){

        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");

        return -1;

    }

    return 0;

}

static int decode_syncpoint(NUTContext *nut){

    AVFormatContext *s= nut->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end;

    uint64_t tmp;

    int i;

    AVRational time_base;



    nut->last_syncpoint_pos= url_ftell(bc)-8;



    end= get_packetheader(nut, bc, 1);

    end += url_ftell(bc) - 4;



    tmp= get_v(bc);

    get_v(bc); 



    time_base= nut->time_base[tmp % nut->time_base_count];

    for(i=0; i<s->nb_streams; i++){

        nut->stream[i].last_pts= av_rescale_rnd(

            tmp / nut->time_base_count,

            time_base.num * (int64_t)nut->stream[i].time_base.den,

            time_base.den * (int64_t)nut->stream[i].time_base.num,

            AV_ROUND_DOWN);

        

    }

    



    if(skip_reserved(bc, end) || check_checksum(bc)){

        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");

        return -1;

    }

    return 0;

}

    return 0;     end += url_ftell(bc) - 4;     if(skip_reserved(bc, end) || check_checksum(bc)){     end += url_ftell(bc) - 4;     if(skip_reserved(bc, end) || check_checksum(bc)){     end += url_ftell(bc) - 4;     if(skip_reserved(bc, end) || check_checksum(bc)){     end += url_ftell(bc) - 4;     if(skip_reserved(bc, end) || check_checksum(bc)){     end += url_ftell(bc) - 4;     if(skip_reserved(bc, end) || check_checksum(bc)){
static int FUNC_0(NUTContext *VAR_0){

    AVFormatContext *s= VAR_0->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end;

    uint64_t tmp;

    int VAR_1;

    AVRational time_base;



    VAR_0->last_syncpoint_pos= url_ftell(bc)-8;



    end= get_packetheader(VAR_0, bc, 1);

    end += url_ftell(bc) - 4;



    tmp= get_v(bc);

    get_v(bc); 



    time_base= VAR_0->time_base[tmp % VAR_0->time_base_count];

    for(VAR_1=0; VAR_1<s->nb_streams; VAR_1++){

        VAR_0->stream[VAR_1].last_pts= av_rescale_rnd(

            tmp / VAR_0->time_base_count,

            time_base.num * (int64_t)VAR_0->stream[VAR_1].time_base.den,

            time_base.den * (int64_t)VAR_0->stream[VAR_1].time_base.num,

            AV_ROUND_DOWN);

        

    }

    



    if(skip_reserved(bc, end) || check_checksum(bc)){

        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");

        return -1;

    }

    return 0;

}

static int FUNC_0(NUTContext *VAR_0){ AVFormatContext *s= VAR_0->avf; ByteIOContext *bc = &s->pb; int64_t end; uint64_t tmp; int VAR_1; AVRational time_base; VAR_0->last_syncpoint_pos= url_ftell(bc)-8; end= get_packetheader(VAR_0, bc, 1); end += url_ftell(bc) - 4; tmp= get_v(bc); get_v(bc); time_base= VAR_0->time_base[tmp % VAR_0->time_base_count]; for(VAR_1=0; VAR_1<s->nb_streams; VAR_1++){ VAR_0->stream[VAR_1].last_pts= av_rescale_rnd(
tmp / VAR_0->time_base_count,
time_base.num * (int64_t)VAR_0->stream[VAR_1].time_base.den,
time_base.den * (int64_t)VAR_0->stream[VAR_1].time_base.num,
AV_ROUND_DOWN); } if(skip_reserved(bc, end) || check_checksum(bc)){ av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n"); return -1; } return 0; }