Skip to content

Commit

Permalink
lavc/videotoolbox: set attachments on decoded buffers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rcombs committed Dec 23, 2021
1 parent 5afc566 commit b04601e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavcodec/videotoolbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit b04601e

Please sign in to comment.