diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2019-12-20 09:17:21 +0800 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-12-20 13:55:22 -0300 |
commit | dbb051767fabddc58a7a24e72eeb715fd303dd62 (patch) | |
tree | dcaa63af7ad21446547b37ef10a14b64db85c0b0 /libavcodec/hevcdec.c | |
parent | 99f505d2df521d83d53f7f9f9b359280f5af168b (diff) | |
download | ffmpeg-dbb051767fabddc58a7a24e72eeb715fd303dd62.tar.gz |
avcodec/hevc_sei: switch to AVBufferRef buffer for a53 caption
Signed-off-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 | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 8f1c162ace..f8270b87c3 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2778,14 +2778,14 @@ static int set_side_data(HEVCContext *s) metadata->MaxCLL, metadata->MaxFALL); } - if (s->sei.a53_caption.a53_caption) { - AVFrameSideData* sd = av_frame_new_side_data(out, - AV_FRAME_DATA_A53_CC, - s->sei.a53_caption.a53_caption_size); - if (sd) - memcpy(sd->data, s->sei.a53_caption.a53_caption, s->sei.a53_caption.a53_caption_size); - av_freep(&s->sei.a53_caption.a53_caption); - s->sei.a53_caption.a53_caption_size = 0; + if (s->sei.a53_caption.buf_ref) { + HEVCSEIA53Caption *a53 = &s->sei.a53_caption; + + AVFrameSideData *sd = av_frame_new_side_data_from_buf(out, AV_FRAME_DATA_A53_CC, a53->buf_ref); + if (!sd) + av_buffer_unref(&a53->buf_ref); + a53->buf_ref = NULL; + s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } |