Merge commit '248dc5c1646dcdd96fe79761105c4ae889e711fd'
authorJames Almer <jamrial@gmail.com>
Tue, 3 Oct 2017 23:09:46 +0000 (20:09 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 3 Oct 2017 23:09:46 +0000 (20:09 -0300)
* commit '248dc5c1646dcdd96fe79761105c4ae889e711fd':
  h264dec: fix dropped initial SEI recovery point

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/h264dec.c

@@@ -487,23 -449,11 +487,22 @@@ void ff_h264_flush_change(H264Context *
      h->next_outputed_poc = INT_MIN;
      h->prev_interlaced_frame = 1;
      idr(h);
 -    if (h->cur_pic_ptr)
 +
 +    h->poc.prev_frame_num = -1;
 +    if (h->cur_pic_ptr) {
          h->cur_pic_ptr->reference = 0;
 +        for (j=i=0; h->delayed_pic[i]; i++)
 +            if (h->delayed_pic[i] != h->cur_pic_ptr)
 +                h->delayed_pic[j++] = h->delayed_pic[i];
 +        h->delayed_pic[j] = NULL;
 +    }
 +    ff_h264_unref_picture(h, &h->last_pic_for_ec);
 +
      h->first_field = 0;
-     ff_h264_sei_uninit(&h->sei);
      h->recovery_frame = -1;
      h->frame_recovered = 0;
 +    h->current_slice = 0;
 +    h->mmco_reset = 1;
  }
  
  /* forget old pics after a seek */