Commit 8c82c4d2 authored by James Almer's avatar James Almer

Merge commit 'ccbb31c1'

* commit 'ccbb31c1':
  qsv: Make sure the session is set with the latest version
Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents 0cef66c9 ccbb31c1
...@@ -1029,6 +1029,23 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx, ...@@ -1029,6 +1029,23 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx,
goto fail; 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); err = MFXVideoCORE_SetHandle(hwctx->session, handle_type, handle);
if (err != MFX_ERR_NONE) { if (err != MFX_ERR_NONE) {
av_log(ctx, AV_LOG_ERROR, "Error setting child device handle: " av_log(ctx, AV_LOG_ERROR, "Error setting child device handle: "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment