forked from FFmpeg/FFmpeg
avutil/hwcontext: Don't assume device_uninit is reentrant
device_uninit will be called by hwdevice_ctx_free. vulkan_device_uninit is non-reentrant. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
39a0c55347
commit
90bbe1e8e2
1 changed files with 2 additions and 9 deletions
|
@ -205,18 +205,11 @@ fail:
|
|||
int av_hwdevice_ctx_init(AVBufferRef *ref)
|
||||
{
|
||||
AVHWDeviceContext *ctx = (AVHWDeviceContext*)ref->data;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (ctx->internal->hw_type->device_init) {
|
||||
if (ctx->internal->hw_type->device_init)
|
||||
ret = ctx->internal->hw_type->device_init(ctx);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
if (ctx->internal->hw_type->device_uninit)
|
||||
ctx->internal->hw_type->device_uninit(ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue