You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user