mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
hwcontext: Perform usual initialisation on derived device contexts
The initialisation should be common. For libmfx, it was previously happening in the derivation function and this moves it out. For VAAPI, it fixes some failures when deriving from a DRM device because this initialisation did not run.
This commit is contained in:
parent
f3602875b3
commit
309d660775
@ -650,6 +650,10 @@ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr,
|
||||
goto fail;
|
||||
|
||||
done:
|
||||
ret = av_hwdevice_ctx_init(dst_ref);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
*dst_ref_ptr = dst_ref;
|
||||
return 0;
|
||||
|
||||
|
@ -1037,16 +1037,6 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = qsv_device_init(ctx);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
if (s->handle_type != handle_type) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Error in child device handle setup: "
|
||||
"type mismatch (%d != %d).\n", s->handle_type, handle_type);
|
||||
err = AVERROR_UNKNOWN;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
Loading…
Reference in New Issue
Block a user