Revision 09e15184 libavformat/nutdec.c

View differences:

libavformat/nutdec.c
27 27
#undef NDEBUG
28 28
#include <assert.h>
29 29

  
30
static uint64_t get_v(ByteIOContext *bc/*, maxstuffing*/){
30
static uint64_t get_v(ByteIOContext *bc){
31 31
    uint64_t val = 0;
32 32

  
33 33
    for(;;)
34 34
    {
35 35
        int tmp = get_byte(bc);
36 36

  
37
//         if(tmp=0x80){
38
//             if(!maxstuffing-- || val)
39
//                 return -1;
40
//         }
41

  
42 37
        if (tmp&0x80)
43 38
            val= (val<<7) + tmp - 0x80;
44 39
        else{
......
810 805
    else if(stream_index == -2) return back_ptr;
811 806

  
812 807
assert(0);
813
    do{
814
        frame_code= get_byte(bc);
815
        if(frame_code == 'N'){
816
            pos= url_ftell(bc)-1;
817
            goto resync;
818
        }
819
        //FIXME consider pos_limit and eof
820
        size= decode_frame_header(nut, &flags, &pts, &stream_id, frame_code);
821

  
822
        if(size < 0)
823
            goto resync;
824

  
825
        url_fseek(bc, size, SEEK_CUR);
826
    }while(stream_id != stream_index || !(flags & FLAG_KEY));
827
    assert(nut->next_startcode == 0);
828
    av_log(s, AV_LOG_DEBUG, "read_timestamp success\n");
829

  
830
    return pts;
831 808
}
832 809

  
833 810
static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags){
......
898 875
    nut_read_packet,
899 876
    nut_read_close,
900 877
    read_seek,
901
//    nut_read_timestamp,
902 878
    .extensions = "nut",
903 879
};
904 880
#endif

Also available in: Unified diff