diff options
author | James Almer <jamrial@gmail.com> | 2019-12-20 20:05:42 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-12-21 22:10:21 +0300 |
commit | 231ffd7e6301e13431ebb3520827d60ac2a3eb64 (patch) | |
tree | fa00ac98d96329f1a7015e3aec6d9d923fe596aa /libavcodec/hevcdec.c | |
parent | e890ce62ef7b5b04b42743caf10b2ac93c89ef04 (diff) |
avcodec/hevcdec: keep closed captions in sync between multiple thread contexts
Based on h264 code.
Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r-- | libavcodec/hevcdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index f8270b87c3..19b0cd815d 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3463,6 +3463,13 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->max_ra = INT_MAX; } + av_buffer_unref(&s->sei.a53_caption.buf_ref); + if (s0->sei.a53_caption.buf_ref) { + s->sei.a53_caption.buf_ref = av_buffer_ref(s0->sei.a53_caption.buf_ref); + if (!s->sei.a53_caption.buf_ref) + return AVERROR(ENOMEM); + } + s->sei.frame_packing = s0->sei.frame_packing; s->sei.display_orientation = s0->sei.display_orientation; s->sei.mastering_display = s0->sei.mastering_display; |