Merge commit '792b9c9dfcf44b657d7854368d975b5ca3bc22ca'
authorHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 11:59:25 +0000 (12:59 +0100)
committerHendrik Leppkes <h.leppkes@gmail.com>
Thu, 17 Dec 2015 11:59:25 +0000 (12:59 +0100)
* commit '792b9c9dfcf44b657d7854368d975b5ca3bc22ca':
  h264: set frame_num in start_frame(), not decode_slice_header()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavcodec/h264_slice.c

@@@ -595,7 -553,7 +595,8 @@@ static int h264_frame_start(H264Contex
      pic->reference              = h->droppable ? 0 : h->picture_structure;
      pic->f->coded_picture_number = h->coded_picture_number++;
      pic->field_picture          = h->picture_structure != PICT_FRAME;
+     pic->frame_num               = h->frame_num;
 +
      /*
       * Zero key_frame here; IDR markings per slice in frame or fields are ORed
       * in later.
@@@ -1654,21 -1417,9 +1655,18 @@@ int ff_h264_decode_slice_header(H264Con
          } else {
              release_unused_pictures(h, 0);
          }
 +        /* Some macroblocks can be accessed before they're available in case
 +        * of lost slices, MBAFF or threading. */
 +        if (FIELD_PICTURE(h)) {
 +            for(i = (h->picture_structure == PICT_BOTTOM_FIELD); i<h->mb_height; i++)
 +                memset(h->slice_table + i*h->mb_stride, -1, (h->mb_stride - (i+1==h->mb_height)) * sizeof(*h->slice_table));
 +        } else {
 +            memset(h->slice_table, -1,
 +                (h->mb_height * h->mb_stride - 1) * sizeof(*h->slice_table));
 +        }
      }
  
-     if (!h->setup_finished)
-         h->cur_pic_ptr->frame_num = h->frame_num; // FIXME frame_num cleanup
 -    assert(h->mb_num == h->mb_width * h->mb_height);
 +    av_assert1(h->mb_num == h->mb_width * h->mb_height);
      if (first_mb_in_slice << FIELD_OR_MBAFF_PICTURE(h) >= h->mb_num ||
          first_mb_in_slice >= h->mb_num) {
          av_log(h->avctx, AV_LOG_ERROR, "first_mb_in_slice overflow\n");