mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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>
This commit is contained in:
parent
872ea3dfe5
commit
08b1d1d812
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user