diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-13 00:43:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-13 00:43:25 +0200 |
commit | ad92410d900b985cdabc499f0badaad72dd5ea2d (patch) | |
tree | 22dba2b13f99b444fdf03dc6f3ba0ea5ce7b7e37 /libavcodec/hevc.c | |
parent | bcc6c7bb65f3b7adc525de4f7fed6d9648a01b1b (diff) | |
download | ffmpeg-ad92410d900b985cdabc499f0badaad72dd5ea2d.tar.gz |
avcodec/hevc: Move skipped_bytes_pos_nal to HEVCNAL, simplify code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r-- | libavcodec/hevc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index a77672c02e..63a2c2f66d 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2781,7 +2781,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) /* decode the NAL units */ for (i = 0; i < s->pkt.nb_nals; i++) { - s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i]; + s->skipped_bytes_pos = s->pkt.nals[i].skipped_bytes_pos_nal; ret = decode_nal_unit(s, &s->pkt.nals[i]); if (ret < 0) { @@ -2971,11 +2971,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) av_freep(&s->md5_ctx); - for(i=0; i < s->pkt.nals_allocated; i++) { - av_freep(&s->skipped_bytes_pos_nal[i]); - } - av_freep(&s->skipped_bytes_pos_nal); - av_freep(&s->cabac_state); for (i = 0; i < 3; i++) { @@ -3014,8 +3009,10 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) s->HEVClc = NULL; av_freep(&s->HEVClcList[0]); - for (i = 0; i < s->pkt.nals_allocated; i++) + for (i = 0; i < s->pkt.nals_allocated; i++) { av_freep(&s->pkt.nals[i].rbsp_buffer); + av_freep(&s->pkt.nals[i].skipped_bytes_pos_nal); + } av_freep(&s->pkt.nals); s->pkt.nals_allocated = 0; |