fix max b frames with b frame strategy 1
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 May 2005 22:20:26 +0000 (22:20 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 May 2005 22:20:26 +0000 (22:20 +0000)
Originally committed as revision 4300 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegvideo.c

index 7bf4bfd..fae6110 100644 (file)
@@ -2201,7 +2201,7 @@ static void select_input_picture(MpegEncContext *s){
                                                s->input_picture[i-1]->data[0], s->linesize) + 1;
                     }
                 }
                                                s->input_picture[i-1]->data[0], s->linesize) + 1;
                     }
                 }
-                for(i=0; i<s->max_b_frames; i++){
+                for(i=0; i<s->max_b_frames+1; i++){
                     if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/40) break;
                 }
                                 
                     if(s->input_picture[i]==NULL || s->input_picture[i]->b_frame_score - 1 > s->mb_num/40) break;
                 }