[FFmpeg-cvslog] avcodec/videotoolbox: prefer hw_frames_ctx/hw_device_ctx over hwaccel_context

Zhao Zhili git at videolan.org
Thu Jan 26 18:01:35 EET 2023


ffmpeg | branch: master | Zhao Zhili <zhilizhao at tencent.com> | Mon Jan  9 20:50:04 2023 +0800| [ade89bc6defb0c8996088d59ab0c8eb437156da5] | committer: Zhao Zhili

avcodec/videotoolbox: prefer hw_frames_ctx/hw_device_ctx over hwaccel_context

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ade89bc6defb0c8996088d59ab0c8eb437156da5
---

 libavcodec/videotoolbox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index a18b49007d..acf0c79822 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -1181,7 +1181,8 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx)
 
     vtctx->logctx = avctx;
 
-    if (avctx->hwaccel_context)
+    if (!avctx->hw_frames_ctx && !avctx->hw_device_ctx &&
+            avctx->hwaccel_context)
         return videotoolbox_start(avctx);
 
     if (!avctx->hw_frames_ctx && !avctx->hw_device_ctx) {



More information about the ffmpeg-cvslog mailing list