From de923595fd1c3ad4f01c700c40ef8ccce133d6ad Mon Sep 17 00:00:00 2001 From: James Almer Date: Sun, 6 Oct 2024 15:00:33 -0300 Subject: [PATCH] avcodec/videotoolbox: choose AYUV pixel format when ideal Signed-off-by: James Almer --- libavcodec/videotoolbox.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 90c1fbfb10..a606c29ded 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -1180,11 +1180,10 @@ static enum AVPixelFormat videotoolbox_best_pixel_format(AVCodecContext *avctx) if (!descriptor) return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context() + depth = descriptor->comp[0].depth; if (descriptor->flags & AV_PIX_FMT_FLAG_ALPHA) - return AV_PIX_FMT_AYUV64; - - depth = descriptor->comp[0].depth; + return (depth > 8) ? AV_PIX_FMT_AYUV64 : AV_PIX_FMT_AYUV; #if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE if (depth > 10)