[FFmpeg-cvslog] h264dec: add forgotten copying of h->sync

Michael Niedermayer git at videolan.org
Sun Sep 18 21:59:43 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Sep 18 19:02:37 2011 +0200| [ba5ff1b31ea46098ef24ac43d8b37f451adec0b7] | committer: Michael Niedermayer

h264dec: add forgotten copying of h->sync

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 227c890..9e2b554 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1201,6 +1201,7 @@ static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContex
     copy_picture_range(h->delayed_pic, h1->delayed_pic, MAX_DELAYED_PIC_COUNT+2, s, s1);
 
     h->last_slice_type = h1->last_slice_type;
+    h->sync            = h1->sync;
 
     if(!s->current_picture_ptr) return 0;
 
@@ -1432,6 +1433,10 @@ static void decode_postinit(H264Context *h, int setup_finished){
         av_log(s->avctx, AV_LOG_DEBUG, "no picture\n");
     }
 
+    if (h->next_output_pic && h->next_output_pic->sync) {
+        h->sync |= 2*!!h->next_output_pic->f.key_frame;
+    }
+
     if (setup_finished)
         ff_thread_finish_setup(s->avctx);
 }
@@ -3920,7 +3925,6 @@ static int decode_frame(AVCodecContext *avctx,
 
         *data_size = 0; /* Wait for second field. */
         if (h->next_output_pic && h->next_output_pic->sync) {
-            h->sync |= 2*!!h->next_output_pic->f.key_frame;
             if(h->sync>1 || h->next_output_pic->f.pict_type != AV_PICTURE_TYPE_B){
                 *data_size = sizeof(AVFrame);
                 *pict = *(AVFrame*)h->next_output_pic;



More information about the ffmpeg-cvslog mailing list