diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-04-29 16:22:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-29 16:33:46 +0300 |
commit | 07a79cf8694ac685ae8f579ccc33d113eb46fe3d (patch) | |
tree | 75920179e81a146478832713c24a5208fde4d81d /libavcodec/h264.c | |
parent | 4a95cd5d9b4b5a48e438827c9c8f048d86abc14c (diff) | |
parent | 7a4f74eed51f914e9bbfebaffd4a92ac6791f819 (diff) |
Merge commit '7a4f74eed51f914e9bbfebaffd4a92ac6791f819'
* commit '7a4f74eed51f914e9bbfebaffd4a92ac6791f819':
h264: embed the DPB in the context
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 8c909c2b00..99b99e7a29 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -621,9 +621,6 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) return AVERROR(ENOMEM); } - h->DPB = av_mallocz_array(H264_MAX_PICTURE_COUNT, sizeof(*h->DPB)); - if (!h->DPB) - return AVERROR(ENOMEM); for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) av_frame_unref(&h->DPB[i].f); av_frame_unref(&h->cur_pic.f); @@ -1084,9 +1081,8 @@ static void flush_dpb(AVCodecContext *avctx) ff_h264_flush_change(h); - if (h->DPB) - for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) - ff_h264_unref_picture(h, &h->DPB[i]); + for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) + ff_h264_unref_picture(h, &h->DPB[i]); h->cur_pic_ptr = NULL; ff_h264_unref_picture(h, &h->cur_pic); @@ -1850,12 +1846,9 @@ av_cold void ff_h264_free_context(H264Context *h) ff_h264_free_tables(h); - if (h->DPB) { - for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) - ff_h264_unref_picture(h, &h->DPB[i]); - memset(h->delayed_pic, 0, sizeof(h->delayed_pic)); - av_freep(&h->DPB); - } + for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) + ff_h264_unref_picture(h, &h->DPB[i]); + memset(h->delayed_pic, 0, sizeof(h->delayed_pic)); h->cur_pic_ptr = NULL; |