hevc: store the VPS list as an AVBufferRef, just like the others *PS

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Gildas Cocherel 2013-12-10 15:42:28 +01:00 committed by Anton Khirnov
parent b769cf4b44
commit 33452aede6
3 changed files with 20 additions and 10 deletions

View file

@ -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]) {