Browse Source

qsv: Make sure the session is set with the latest version

It is needed to have the calls to MFXJoinSession succeed.
tags/n4.0
Luca Barbato 8 years ago
parent
commit
ccbb31c14b
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      libavutil/hwcontext_qsv.c

+ 17
- 0
libavutil/hwcontext_qsv.c View File

@@ -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…
Cancel
Save