changeset 4111:bfc1532904eb libavcodec

fix 1/0 b frames + CBR bug
author michael
date Tue, 31 Oct 2006 22:22:11 +0000
parents e7e72aad32e4
children 29f5edb4430a
files mpegvideo.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Tue Oct 31 11:19:51 2006 +0000
+++ b/mpegvideo.c	Tue Oct 31 22:22:11 2006 +0000
@@ -2542,6 +2542,10 @@
                     if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
                         s->no_rounding ^= 1;
                 }
+                if(s->pict_type!=B_TYPE){
+                    s->time_base= s->last_time_base;
+                    s->last_non_b_time= s->time - s->pp_time;
+                }
 //                av_log(NULL, AV_LOG_ERROR, "R:%d ", s->next_lambda);
                 for(i=0; i<avctx->thread_count; i++){
                     PutBitContext *pb= &s->thread_context[i]->pb;