提交 865360ba 编写于 作者: W wm4

lavc: set avctx->hwaccel before init

So a hwaccel can access avctx->hwaccel in init for whatever reason. This
is for the new d3d hwaccel API. We could create separate entrypoints for
each of the 3 hwaccel types (dxva2, d3d11va, new d3d11va), but this
seems nicer.

Merges Libav commit bd747b92.
Signed-off-by: NDiego Biurrun <diego@biurrun.de>
上级 3303511f
......@@ -1248,16 +1248,16 @@ static int setup_hwaccel(AVCodecContext *avctx,
return AVERROR(ENOMEM);
}
avctx->hwaccel = hwa;
if (hwa->init) {
ret = hwa->init(avctx);
if (ret < 0) {
av_freep(&avctx->internal->hwaccel_priv_data);
avctx->hwaccel = NULL;
return ret;
}
}
avctx->hwaccel = hwa;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册