static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){

    AVFormatContext *s= nut->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end, tmp;

    AVRational time_base;



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



    end= get_packetheader(nut, bc, 1);

    end += url_ftell(bc);



    tmp= get_v(bc);

    *back_ptr= nut->last_syncpoint_pos - 16*get_v(bc);

    if(*back_ptr < 0)

        return -1;



    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp);



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

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

        return -1;

    }



    *ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE;

    add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);



    return 0;

}

static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){

    AVFormatContext *s= nut->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end, tmp;

    AVRational time_base;



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



    end= get_packetheader(nut, bc, 1);

    end += url_ftell(bc);



    tmp= get_v(bc);

    *back_ptr= nut->last_syncpoint_pos - 16*get_v(bc);

    if(*back_ptr < 0)

        return -1;



    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp);



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

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

        return -1;

    }



    *ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE;

    add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);



    return 0;

}

static int FUNC_0(NUTContext *VAR_0, int64_t *VAR_1, int64_t *VAR_2){

    AVFormatContext *s= VAR_0->avf;

    ByteIOContext *bc = &s->pb;

    int64_t end, tmp;

    AVRational time_base;



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



    end= get_packetheader(VAR_0, bc, 1);

    end += url_ftell(bc);



    tmp= get_v(bc);

    *VAR_2= VAR_0->last_syncpoint_pos - 16*get_v(bc);

    if(*VAR_2 < 0)

        return -1;



    ff_nut_reset_ts(VAR_0, VAR_0->time_base[tmp % VAR_0->time_base_count], tmp);



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

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

        return -1;

    }



    *VAR_1= tmp / s->nb_streams * av_q2d(VAR_0->time_base[tmp % s->nb_streams])*AV_TIME_BASE;

    add_sp(VAR_0, VAR_0->last_syncpoint_pos, *VAR_2, *VAR_1);



    return 0;

}

static int FUNC_0(NUTContext *VAR_0, int64_t *VAR_1, int64_t *VAR_2){ AVFormatContext *s= VAR_0->avf; ByteIOContext *bc = &s->pb; int64_t end, tmp; AVRational time_base; VAR_0->last_syncpoint_pos= url_ftell(bc)-8; end= get_packetheader(VAR_0, bc, 1); end += url_ftell(bc); tmp= get_v(bc); *VAR_2= VAR_0->last_syncpoint_pos - 16*get_v(bc); if(*VAR_2 < 0)
return -1; ff_nut_reset_ts(VAR_0, VAR_0->time_base[tmp % VAR_0->time_base_count], tmp); if(skip_reserved(bc, end) || get_checksum(bc)){ av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n"); return -1; } *VAR_1= tmp / s->nb_streams * av_q2d(VAR_0->time_base[tmp % s->nb_streams])*AV_TIME_BASE; add_sp(VAR_0, VAR_0->last_syncpoint_pos, *VAR_2, *VAR_1); return 0; }