Revision 1c2a8c7f libavcodec/h263dec.c

View differences:

libavcodec/h263dec.c
135 135
    } else {
136 136
        ret = h263_decode_picture_header(s);
137 137
    }
138
    if(ret==FRAME_SKIPED) return 0;
139 138

  
140 139
        /* After H263 & mpeg4 header decode we have the height, width,*/
141 140
        /* and other parameters. So then we could init the picture   */
......
154 153
            return -1;
155 154
    }
156 155

  
156
    if(ret==FRAME_SKIPED) return 0;
157 157
    if (ret < 0)
158 158
        return -1;
159

  
159
    /* skip b frames if we dont have reference frames */
160
    if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return 0;
161
        
160 162
    MPV_frame_start(s);
161 163

  
162 164
#ifdef DEBUG
......
222 224
            }
223 225
            MPV_decode_mb(s, s->block);
224 226
        }
225
        if (avctx->draw_horiz_band) {
227
        if (    avctx->draw_horiz_band 
228
            && (s->num_available_buffers>=1 || (!s->has_b_frames)) ) {
226 229
            UINT8 *src_ptr[3];
227 230
            int y, h, offset;
228 231
            y = s->mb_y * 16;
......
279 282
    /* we substract 1 because it is added on utils.c    */
280 283
    avctx->frame_number = s->picture_number - 1;
281 284

  
282
    *data_size = sizeof(AVPicture);
285
    /* dont output the last pic after seeking 
286
       note we allready added +1 for the current pix in MPV_frame_end(s) */
287
    if(s->num_available_buffers>=2 || (!s->has_b_frames))
288
        *data_size = sizeof(AVPicture);
289

  
283 290
    return buf_size;
284 291
}
285 292

  

Also available in: Unified diff