avcodec/videotoolbox: prefer hw_frames_ctx/hw_device_ctx over hwaccel_context

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
Zhao Zhili
2023-01-26 23:48:08 +08:00
parent 79e9bdf749
commit ade89bc6de
+2 -1
View File
@@ -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) {