Revision eec1c6b9 libavcodec/h263dec.c

View differences:

libavcodec/h263dec.c
119 119
        return 0;
120 120
    }
121 121

  
122
    init_get_bits(&s->gb, buf, buf_size);
122
    if(s->bitstream_buffer_size) //divx 5.01+ frame reorder
123
        init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size);
124
    else
125
        init_get_bits(&s->gb, buf, buf_size);
123 126

  
124 127
    /* let's go :-) */
125 128
    if (s->h263_msmpeg4) {
......
131 134
    } else {
132 135
        ret = h263_decode_picture_header(s);
133 136
    }
137
    if(ret==FRAME_SKIPED) return 0;
134 138

  
135 139
        /* After H263 & mpeg4 header decode we have the height, width,*/
136 140
        /* and other parameters. So then we could init the picture   */
......
241 245
    
242 246
    if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==I_TYPE)
243 247
        if(msmpeg4_decode_ext_header(s, buf_size) < 0) return -1;
244

  
248
    
249
    /* divx 5.01+ bistream reorder stuff */
250
    if(s->h263_pred && s->bitstream_buffer_size==0){
251
        int current_pos= get_bits_count(&s->gb)/8;
252
        if(   buf_size - current_pos > 5 
253
           && buf_size - current_pos < BITSTREAM_BUFFER_SIZE){
254
            memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos);
255
            s->bitstream_buffer_size= buf_size - current_pos;
256
        }
257
    }else
258
        s->bitstream_buffer_size=0;
259
  
245 260
    MPV_frame_end(s);
246 261
    
247 262
    if(s->pict_type==B_TYPE || (!s->has_b_frames)){

Also available in: Unified diff