You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Revert "avutil/hwcontext_vaapi: fix SEGV in vaTerminate when vaInitialize fails"
The original code is correctly following the API - vaTerminate() must
be called to free the resources of a VADisplay after it is created by
any of the vaGetDisplay*() calls; it is not necessary to have
successfully called vaInitialize() on it. The segfaults which
prompted this change must therefore be bugs in libva or the driver it
loads.
This reverts commit 3606602f11
.
This commit is contained in:
@@ -961,13 +961,14 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hwctx->display = display;
|
||||||
|
|
||||||
vas = vaInitialize(display, &major, &minor);
|
vas = vaInitialize(display, &major, &minor);
|
||||||
if (vas != VA_STATUS_SUCCESS) {
|
if (vas != VA_STATUS_SUCCESS) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "Failed to initialise VAAPI "
|
av_log(ctx, AV_LOG_ERROR, "Failed to initialise VAAPI "
|
||||||
"connection: %d (%s).\n", vas, vaErrorStr(vas));
|
"connection: %d (%s).\n", vas, vaErrorStr(vas));
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
hwctx->display = display;
|
|
||||||
av_log(ctx, AV_LOG_VERBOSE, "Initialised VAAPI connection: "
|
av_log(ctx, AV_LOG_VERBOSE, "Initialised VAAPI connection: "
|
||||||
"version %d.%d\n", major, minor);
|
"version %d.%d\n", major, minor);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user