[FFmpeg-devel] [PATCH 06/16] lavc/videotoolbox: fix format computation

rcombs rcombs at rcombs.me
Mon Nov 22 22:53:20 EET 2021


Use sw_pix_fmt instead of pix_fmt (consistent with other hwaccels)
---
 libavcodec/videotoolbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index bd6e769207..010f553e57 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -1059,7 +1059,7 @@ static int videotoolbox_uninit(AVCodecContext *avctx)
 }
 
 static enum AVPixelFormat videotoolbox_best_pixel_format(AVCodecContext *avctx) {
-    const AVPixFmtDescriptor *descriptor = av_pix_fmt_desc_get(avctx->pix_fmt);
+    const AVPixFmtDescriptor *descriptor = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
     if (!descriptor)
         return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context()
 
-- 
2.33.1



More information about the ffmpeg-devel mailing list