]> git.sesse.net Git - ffmpeg/commitdiff
Try to set has_b_frames in codec init if we know everything alraedy.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Feb 2010 01:08:54 +0000 (01:08 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Feb 2010 01:08:54 +0000 (01:08 +0000)
This fixes some issues with the first few timestamps.

Originally committed as revision 21976 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.c

index 0db913a1f3b26dd39078f3370a4bf080a0cde15b..31a786c14bddf2f6c410c9547ef40f0ace52665a 100644 (file)
@@ -917,6 +917,10 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){
         if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0)
             return -1;
     }
+    if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames < h->sps.num_reorder_frames){
+        s->avctx->has_b_frames = h->sps.num_reorder_frames;
+        s->low_delay = 0;
+    }
 
     return 0;
 }