summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolbox.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-18 05:02:47 -0600
committerrcombs <rcombs@rcombs.me>2021-12-22 18:43:34 -0600
commitb04601ed6ab91c4f6f5cbe08050ea1e4d001cec4 (patch)
tree1f16a5727221a02a9e1fb3396a0ba74ebaae46f3 /libavcodec/videotoolbox.c
parent5afc5661ac042f04111305c34020e9b0ff87400f (diff)
lavc/videotoolbox: set attachments on decoded buffers
VideoToolbox internally sets all the colorspace parameters to BT709, regardless of what the bitstream actually indicates, so we need to replace that with what we've parsed.
Diffstat (limited to 'libavcodec/videotoolbox.c')
-rw-r--r--libavcodec/videotoolbox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 519f55a9ab..69beb3881f 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -90,6 +90,7 @@ int ff_videotoolbox_buffer_copy(VTContext *vtctx,
static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame)
{
+ int ret;
VTHWFrame *ref = (VTHWFrame *)frame->buf[0]->data;
if (!ref->pixbuf) {
@@ -103,6 +104,9 @@ static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame)
frame->crop_top = 0;
frame->crop_bottom = 0;
+ if ((ret = av_vt_pixbuf_set_attachments(avctx, ref->pixbuf, frame)) < 0)
+ return ret;
+
frame->data[3] = (uint8_t*)ref->pixbuf;
if (ref->hw_frames_ctx) {