summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ec57d6d2f7..6b12b303d7 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -851,18 +851,11 @@ static void decode_postinit(H264Context *h, int setup_finished)
// FIXME do something with unavailable reference frames
/* Sort B-frames into display order */
-
- if (h->sps.bitstream_restriction_flag &&
- h->avctx->has_b_frames < h->sps.num_reorder_frames) {
- h->avctx->has_b_frames = h->sps.num_reorder_frames;
- h->low_delay = 0;
- }
-
- if (h->avctx->strict_std_compliance >= FF_COMPLIANCE_STRICT &&
- !h->sps.bitstream_restriction_flag) {
- h->avctx->has_b_frames = MAX_DELAYED_PIC_COUNT - 1;
- h->low_delay = 0;
+ if (h->sps.bitstream_restriction_flag ||
+ h->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
+ h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, h->sps.num_reorder_frames);
}
+ h->low_delay = !h->avctx->has_b_frames;
pics = 0;
while (h->delayed_pic[pics])