diff options
author | Gildas Cocherel <gildas.cocherel@laposte.net> | 2013-12-10 15:42:28 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-12-11 20:39:54 +0100 |
commit | 33452aede6acab78f726cd1924824585f00765cc (patch) | |
tree | 1308202d92537c6330a95cf46beb0e22fbf7b891 /libavcodec/hevc.c | |
parent | b769cf4b44c8112827c2fdfcab74bd95600fd6d3 (diff) | |
download | ffmpeg-33452aede6acab78f726cd1924824585f00765cc.tar.gz |
hevc: store the VPS list as an AVBufferRef, just like the others *PS
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index b7e7757fae..d969f5eea7 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -431,7 +431,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps) } s->sps = sps; - s->vps = s->vps_list[s->sps->vps_id]; + s->vps = (HEVCVPS*) s->vps_list[s->sps->vps_id]->data; return 0; fail: @@ -2924,7 +2924,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) } for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++) - av_freep(&s->vps_list[i]); + av_buffer_unref(&s->vps_list[i]); for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) av_buffer_unref(&s->sps_list[i]); for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++) @@ -2999,6 +2999,15 @@ static int hevc_update_thread_context(AVCodecContext *dst, } } + for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++) { + av_buffer_unref(&s->vps_list[i]); + if (s0->vps_list[i]) { + s->vps_list[i] = av_buffer_ref(s0->vps_list[i]); + if (!s->vps_list[i]) + return AVERROR(ENOMEM); + } + } + for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++) { av_buffer_unref(&s->sps_list[i]); if (s0->sps_list[i]) { |