diff mbox series

[FFmpeg-devel,2/5] avcodec/videotoolbox: prefer hw_frames_ctx/hw_device_ctx over hwaccel_context

Message ID tencent_35279C28E0745AA6346B809E34E33F755609@qq.com
State Accepted
Commit ade89bc6defb0c8996088d59ab0c8eb437156da5
Headers show
Series None | expand

Commit Message

Zhao Zhili Jan. 9, 2023, 12:50 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

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

Patch

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) {