diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-12-12 12:02:58 -0800 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-12-16 11:24:18 -0800 |
commit | 0b4c323213343bf514626ee89a7ad91bfd428322 (patch) | |
tree | 3fb82025da273e79a3556c81acada36a27b5ce21 | |
parent | b8909cb3648c135411c17152e2cb3fde4df452d3 (diff) | |
download | ffmpeg-0b4c323213343bf514626ee89a7ad91bfd428322.tar.gz |
h264: don't drop B-frames after next keyframe on POC reset.
The keyframe after a POC reset may not be the first to be returned to
the user. Therefore, don't reset the expected next POC once we return
a keyframe to the user, but once we know that the next frame in the
return-queue is a keyframe.
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 109a109530..77acd7168f 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1530,7 +1530,11 @@ static void decode_postinit(H264Context *h, int setup_finished){ h->next_outputed_poc = INT_MIN; } } else { - h->next_outputed_poc = out->poc; + if (out_idx == 0 && pics > 1 && h->delayed_pic[0]->f.key_frame) { + h->next_outputed_poc = INT_MIN; + } else { + h->next_outputed_poc = out->poc; + } } h->mmco_reset = 0; }else{ |