[FFmpeg-devel] [PATCH] avutil/hwcontext_videotoolbox: Correctly set trc

gnattu gnattuoc at me.com
Fri Aug 2 02:31:03 EEST 2024


The color trc key was assigned a color primaries value which causes
the resulting colorspace is always SDR.

Fixes #10884.

Signed-off-by: Gnattu OC <gnattuoc at me.com>
---
 libavutil/hwcontext_videotoolbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
index 1794459943..80eaab64f0 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -597,7 +597,7 @@ static int vt_pixbuf_set_colorspace(void *log_ctx,
     colortrc = av_map_videotoolbox_color_trc_from_av(src->color_trc);
     if (colortrc)
         CVBufferSetAttachment(pixbuf, kCVImageBufferTransferFunctionKey,
-            colorpri, kCVAttachmentMode_ShouldPropagate);
+            colortrc, kCVAttachmentMode_ShouldPropagate);
     else {
         CVBufferRemoveAttachment(pixbuf, kCVImageBufferTransferFunctionKey);
         if (src->color_trc != AVCOL_TRC_UNSPECIFIED)
-- 
2.39.3 (Apple Git-146)



More information about the ffmpeg-devel mailing list