diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2017-09-25 09:57:30 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2017-09-27 12:27:34 +0000 |
commit | ccbb31c14b766ef666ef2daa8c467e478183a957 (patch) | |
tree | a8cf1c53c2e2441bb0d483000a51ce2351cd6689 /libavutil | |
parent | 516c479172755c63063180b0c0953b68b670cdbd (diff) | |
download | ffmpeg-ccbb31c14b766ef666ef2daa8c467e478183a957.tar.gz |
qsv: Make sure the session is set with the latest version
It is needed to have the calls to MFXJoinSession succeed.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/hwcontext_qsv.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index e0f6875b40..5018a05b9a 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -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: " |