summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-10-15 02:37:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-15 02:37:04 +0000
commit035817727fc64430631f3489ee10add63ff6cdc0 (patch)
tree0a557523630c64dd87039e9654f7fd5d555e5cd9 /libavcodec/mpegvideo.c
parent9efc77c86f0360d8447fe1c655ad0fd35b23f305 (diff)
support strictly enforcing gop size
Originally committed as revision 3594 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f5e835975c..fc7cd00540 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2064,9 +2064,13 @@ static void select_input_picture(MpegEncContext *s){
}
if(s->picture_in_gop_number + b_frames >= s->gop_size){
+ if((s->flags2 & CODEC_FLAG2_STRICT_GOP) && s->gop_size > s->picture_in_gop_number){
+ b_frames= s->gop_size - s->picture_in_gop_number - 1;
+ }else{
if(s->flags & CODEC_FLAG_CLOSED_GOP)
b_frames=0;
s->input_picture[b_frames]->pict_type= I_TYPE;
+ }
}
if( (s->flags & CODEC_FLAG_CLOSED_GOP)