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-09 20:50:04 +08:00
parent 79e9bdf749
commit ade89bc6de
1 changed files with 2 additions and 1 deletions

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