Merge commit '1f097d168d9cad473dd44010a337c1413a9cd198'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 15:26:43 +0000 (16:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Feb 2014 15:44:32 +0000 (16:44 +0100)
* commit '1f097d168d9cad473dd44010a337c1413a9cd198':
  h264: reset data partitioning at the beginning of each decode call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h264.c

@@@ -1846,12 -1764,11 +1846,11 @@@ static int decode_update_thread_context
      h->picture_structure    = h1->picture_structure;
      h->qscale               = h1->qscale;
      h->droppable            = h1->droppable;
-     h->data_partitioning    = h1->data_partitioning;
      h->low_delay            = h1->low_delay;
  
 -    for (i = 0; i < MAX_PICTURE_COUNT; i++) {
 +    for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
          unref_picture(h, &h->DPB[i]);
 -        if (h1->DPB[i].f.buf[0] &&
 +        if (h1->DPB && h1->DPB[i].f.buf[0] &&
              (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
              return ret;
      }
@@@ -5153,13 -4900,17 +5159,16 @@@ static int h264_decode_frame(AVCodecCon
      int ret;
  
      h->flags = avctx->flags;
+     /* reset data partitioning here, to ensure GetBitContexts from previous
+      * packets do not get used. */
+     h->data_partitioning = 0;
  
      /* end of stream, output what is still in the buffers */
 -out:
      if (buf_size == 0) {
 -        Picture *out;
 -        int i, out_idx;
 + out:
  
          h->cur_pic_ptr = NULL;
 +        h->first_field = 0;
  
          // FIXME factorize this with the output code below
          out     = h->delayed_pic[0];