aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJohn Stebbins <jstebbins@jetheaddev.com>2018-06-27 15:12:24 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-28 21:35:01 +0200
commit08b1d1d8122517d07f2335437cde0aeedc50143f (patch)
tree3e8e7b258253836fb47d802d8abb14f25cde20cd /libavcodec
parent872ea3dfe565098570ad213a6f1eb00a805aec5d (diff)
downloadffmpeg-08b1d1d8122517d07f2335437cde0aeedc50143f.tar.gz
h264_slice: Fix return of incomplete frames from decoder
When not using libavformat for demuxing, AVCodecContext.has_b_frames gets set too late causing the recovery frame heuristic in h264_refs to incorrectly flag an early frame as recovered. This patch sets has_b_frames earlier to prevent improperly flagging the frame as recovered. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_slice.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d71ddbe9ba..ede9a1a6ea 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1407,6 +1407,11 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
sps = h->ps.sps;
+ if (sps && sps->bitstream_restriction_flag &&
+ h->avctx->has_b_frames < sps->num_reorder_frames) {
+ h->avctx->has_b_frames = sps->num_reorder_frames;
+ }
+
last_pic_droppable = h->droppable;
last_pic_structure = h->picture_structure;
h->droppable = (nal->ref_idc == 0);