summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-23 01:08:54 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-23 01:08:54 +0000
commitdb8cb47d15c3ffd13d7230c6391487ffb2a9b3a5 (patch)
tree17ecd1dd8088ed2a87bff0475039a07d2cd16d9e /libavcodec/h264.c
parent9855b2e3c87157b27c777e7ce2325220d98f213e (diff)
Try to set has_b_frames in codec init if we know everything alraedy.
This fixes some issues with the first few timestamps. Originally committed as revision 21976 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 0db913a1f3..31a786c14b 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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;
}