mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
qsv: Make sure the session is set with the latest version
It is needed to have the calls to MFXJoinSession succeed.
This commit is contained in:
parent
516c479172
commit
ccbb31c14b
@ -1029,6 +1029,23 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
err = MFXQueryVersion(hwctx->session, &ver);
|
||||
if (err != MFX_ERR_NONE) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Error querying an MFX session: %d.\n", err);
|
||||
ret = AVERROR_UNKNOWN;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
MFXClose(hwctx->session);
|
||||
|
||||
err = MFXInit(implementation, &ver, &hwctx->session);
|
||||
if (err != MFX_ERR_NONE) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"Error initializing an MFX session: %d.\n", err);
|
||||
ret = AVERROR_UNKNOWN;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
err = MFXVideoCORE_SetHandle(hwctx->session, handle_type, handle);
|
||||
if (err != MFX_ERR_NONE) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Error setting child device handle: "
|
||||
|
Loading…
Reference in New Issue
Block a user