# HG changeset patch # User michael # Date 1216435457 0 # Node ID 4d3c6cd510031b5c4f234b99ef234f65bd938d22 # Parent 29319d07aeb4c111d5b3ea81104d215a9c197f43 Drop out of order pics even if bitstream_restriction_flag is set. diff -r 29319d07aeb4 -r 4d3c6cd51003 h264.c --- a/h264.c Sat Jul 19 02:43:23 2008 +0000 +++ b/h264.c Sat Jul 19 02:44:17 2008 +0000 @@ -7861,10 +7861,12 @@ } out_of_order = !cross_idr && prev && out->poc < prev->poc; + + if(prev && pics <= s->avctx->has_b_frames || out_of_order) + out = prev; + if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames) { } - else if(prev && pics <= s->avctx->has_b_frames) - out = prev; else if((out_of_order && pics-1 == s->avctx->has_b_frames && pics < 15) || (s->low_delay && ((!cross_idr && prev && out->poc > prev->poc + 2) @@ -7874,8 +7876,6 @@ s->avctx->has_b_frames++; out = prev; } - else if(out_of_order) - out = prev; if(out_of_order || pics > s->avctx->has_b_frames){ for(i=out_idx; h->delayed_pic[i]; i++)