summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:00:37 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:07:08 +0100
commit10e55bd658b06034d700553190b419b1af92b7cb (patch)
tree5386e0bb31dfdad09a9adb583dbb87368199552e /libavcodec/h264.c
parentc6f1f334cbc50b1821b92afaee13abcd3502b34a (diff)
parentb09ad37c83841c399abb7f2503a2ab214d0c2d48 (diff)
Merge commit 'b09ad37c83841c399abb7f2503a2ab214d0c2d48'
* commit 'b09ad37c83841c399abb7f2503a2ab214d0c2d48': h264: derive the delay from the level when it's not present Merged without changing the strict_std_compliance check, as it breaks FATE and changes decoding behavior. Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
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 3d11328b2d..089a86fe42 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -906,18 +906,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_STRICT) {
+ h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, h->sps.num_reorder_frames);
}
+ h->low_delay = !h->avctx->has_b_frames;
for (i = 0; 1; i++) {
if(i == MAX_DELAYED_PIC_COUNT || cur->poc < h->last_pocs[i]){