]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '7f045c4429e91688f1f2335dd347203431901c06'
authorClément Bœsch <clement@stupeflix.com>
Mon, 20 Jun 2016 10:00:29 +0000 (12:00 +0200)
committerClément Bœsch <clement@stupeflix.com>
Mon, 20 Jun 2016 10:03:21 +0000 (12:03 +0200)
* commit '7f045c4429e91688f1f2335dd347203431901c06':
  h264: merge ff_h264_free_context() into h264_decode_end()

Merged-by: Clément Bœsch <clement@stupeflix.com>
1  2 
libavcodec/h264.c
libavcodec/h264.h

index bf8e12d02264d1ce563a406e7b5099d698215a38,9d7b69c3b591b3f8323b75cb021072e1062dc4dd..bd9f67292a4dae1c19cfbf2c3bd9ba7d96910a8a
@@@ -357,6 -323,39 +357,48 @@@ static int h264_init_context(AVCodecCon
      return 0;
  }
  
+ static av_cold int h264_decode_end(AVCodecContext *avctx)
+ {
+     H264Context *h = avctx->priv_data;
+     int i;
++    ff_h264_remove_all_refs(h);
+     ff_h264_free_tables(h);
+     for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
+         ff_h264_unref_picture(h, &h->DPB[i]);
+         av_frame_free(&h->DPB[i].f);
+     }
++    memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
+     h->cur_pic_ptr = NULL;
+     for (i = 0; i < h->nb_slice_ctx; i++)
+         av_freep(&h->slice_ctx[i].rbsp_buffer);
+     av_freep(&h->slice_ctx);
+     h->nb_slice_ctx = 0;
++    ff_h264_sei_uninit(&h->sei);
++
+     for (i = 0; i < MAX_SPS_COUNT; i++)
+         av_buffer_unref(&h->ps.sps_list[i]);
+     for (i = 0; i < MAX_PPS_COUNT; i++)
+         av_buffer_unref(&h->ps.pps_list[i]);
++    av_buffer_unref(&h->ps.sps_ref);
++    av_buffer_unref(&h->ps.pps_ref);
++
+     ff_h2645_packet_uninit(&h->pkt);
+     ff_h264_unref_picture(h, &h->cur_pic);
+     av_frame_free(&h->cur_pic.f);
++    ff_h264_unref_picture(h, &h->last_pic_for_ec);
++    av_frame_free(&h->last_pic_for_ec.f);
+     return 0;
+ }
  static AVOnce h264_vlc_init = AV_ONCE_INIT;
  
  av_cold int ff_h264_decode_init(AVCodecContext *avctx)
Simple merge