Revision f59d8ff8 libavformat/nutdec.c

View differences:

libavformat/nutdec.c
119 119
    uint64_t state=0;
120 120

  
121 121
    if(pos >= 0)
122
        url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are
122
        avio_seek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are
123 123

  
124 124
    while(!url_feof(bc)){
125 125
        state= (state<<8) | avio_r8(bc);
......
178 178
static int skip_reserved(AVIOContext *bc, int64_t pos){
179 179
    pos -= url_ftell(bc);
180 180
    if(pos<0){
181
        url_fseek(bc, pos, SEEK_CUR);
181
        avio_seek(bc, pos, SEEK_CUR);
182 182
        return -1;
183 183
    }else{
184 184
        while(pos--)
......
513 513
    int8_t *has_keyframe;
514 514
    int ret= -1;
515 515

  
516
    url_fseek(bc, filesize-12, SEEK_SET);
517
    url_fseek(bc, filesize-avio_rb64(bc), SEEK_SET);
516
    avio_seek(bc, filesize-12, SEEK_SET);
517
    avio_seek(bc, filesize-avio_rb64(bc), SEEK_SET);
518 518
    if(avio_rb64(bc) != INDEX_STARTCODE){
519 519
        av_log(s, AV_LOG_ERROR, "no index at the end\n");
520 520
        return -1;
......
655 655
    if(!url_is_streamed(bc)){
656 656
        int64_t orig_pos= url_ftell(bc);
657 657
        find_and_decode_index(nut);
658
        url_fseek(bc, orig_pos, SEEK_SET);
658
        avio_seek(bc, orig_pos, SEEK_SET);
659 659
    }
660 660
    assert(nut->next_startcode == SYNCPOINT_STARTCODE);
661 661

  
......
803 803
        case STREAM_STARTCODE:
804 804
        case INDEX_STARTCODE:
805 805
            skip= get_packetheader(nut, bc, 0, tmp);
806
            url_fseek(bc, skip, SEEK_CUR);
806
            avio_seek(bc, skip, SEEK_CUR);
807 807
            break;
808 808
        case INFO_STARTCODE:
809 809
            if(decode_info_header(nut)<0)
......
900 900
    }
901 901
    av_log(NULL, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos2);
902 902
    pos= find_startcode(s->pb, SYNCPOINT_STARTCODE, pos2);
903
    url_fseek(s->pb, pos, SEEK_SET);
903
    avio_seek(s->pb, pos, SEEK_SET);
904 904
    av_log(NULL, AV_LOG_DEBUG, "SP: %"PRId64"\n", pos);
905 905
    if(pos2 > pos || pos2 + 15 < pos){
906 906
        av_log(NULL, AV_LOG_ERROR, "no syncpoint at backptr pos\n");

Also available in: Unified diff