aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorgcocherel <gildas.cocherel@laposte.net>2013-11-21 11:25:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-22 01:29:02 +0100
commit36658c978f5d7df2ce556075946f3a80f7eca753 (patch)
treee519bb5ee4a878d5897d70b095ab1e9ba9c37b76 /libavcodec/hevc.c
parent7c98c834e0a2855d5c612fd22f6f2826c1116a9a (diff)
downloadffmpeg-36658c978f5d7df2ce556075946f3a80f7eca753.tar.gz
hevc : update hevc_ps.c
(cherry picked from commit 088f2eb1ae42bffc63c2cee4e7eba8f47056043b) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index ec04f8081b..26b0c5f42b 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -325,7 +325,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:
@@ -365,7 +365,6 @@ static int hls_slice_header(HEVCContext *s)
if (s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]->data) {
s->sps = (HEVCSPS*)s->sps_list[s->pps->sps_id]->data;
-
ff_hevc_clear_refs(s);
ret = set_sps(s, s->sps);
if (ret < 0)
@@ -2655,7 +2654,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++)
@@ -2669,7 +2668,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
lc = s->HEVClcList[i];
if (lc) {
av_freep(&lc->edge_emu_buffer);
-
av_freep(&s->HEVClcList[i]);
av_freep(&s->sList[i]);
}
@@ -2755,6 +2753,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]) {