diff options
author | James Almer <jamrial@gmail.com> | 2020-11-12 16:59:37 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2020-11-13 10:38:18 -0300 |
commit | f5517be32a5928b669df57fe91cfa2a2c03f0ba4 (patch) | |
tree | f9dda8411ff8afbe15c2a84387b14bbd7946c822 /libavcodec/av1dec.c | |
parent | 8f4aec719e7c00cd75074ef34d99d2f2f22e622a (diff) | |
download | ffmpeg-f5517be32a5928b669df57fe91cfa2a2c03f0ba4.tar.gz |
avcodec/av1dec: add a reference to the raw frame header to AV1Frames
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1dec.c')
-rw-r--r-- | libavcodec/av1dec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index ad8e7d1dd5..84c9ca93d5 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -442,6 +442,8 @@ static void av1_frame_unref(AVCodecContext *avctx, AV1Frame *f) ff_thread_release_buffer(avctx, &f->tf); av_buffer_unref(&f->hwaccel_priv_buf); f->hwaccel_picture_private = NULL; + av_buffer_unref(&f->header_ref); + f->raw_frame_header = NULL; f->spatial_id = f->temporal_id = 0; f->order_hint = 0; memset(f->skip_mode_frame_idx, 0, @@ -457,6 +459,12 @@ static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *s if (ret < 0) return ret; + dst->header_ref = av_buffer_ref(src->header_ref); + if (!dst->header_ref) + goto fail; + + dst->raw_frame_header = src->raw_frame_header; + if (src->hwaccel_picture_private) { dst->hwaccel_priv_buf = av_buffer_ref(src->hwaccel_priv_buf); if (!dst->hwaccel_priv_buf) @@ -643,6 +651,12 @@ static int av1_frame_alloc(AVCodecContext *avctx, AV1Frame *f) AVFrame *frame; int ret; + f->header_ref = av_buffer_ref(s->header_ref); + if (!f->header_ref) + return AVERROR(ENOMEM); + + f->raw_frame_header = s->raw_frame_header; + ret = update_context_with_frame_header(avctx, header); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to update context with frame header\n"); |