[FFmpeg-cvslog] h264: don't drop B-frames after next keyframe on POC reset.

Ronald S. Bultje git at videolan.org
Sat Dec 17 02:23:02 CET 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Mon Dec 12 12:02:58 2011 -0800| [0b4c323213343bf514626ee89a7ad91bfd428322] | committer: Ronald S. Bultje

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b4c323213343bf514626ee89a7ad91bfd428322
---

 libavcodec/h264.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 109a109..77acd71 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{



More information about the ffmpeg-cvslog mailing list