diff options
author | James Almer <jamrial@gmail.com> | 2017-11-11 15:23:49 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-11 15:23:49 -0300 |
commit | 8c82c4d25d363eca035f2c23e8257c1d4c7a20d3 (patch) | |
tree | fcab095f87c03604548a39d84c7b30c9249068ec | |
parent | 0cef66c906a58c7a9811574fc8a734faa818c094 (diff) | |
parent | ccbb31c14b766ef666ef2daa8c467e478183a957 (diff) | |
download | ffmpeg-8c82c4d25d363eca035f2c23e8257c1d4c7a20d3.tar.gz |
Merge commit 'ccbb31c14b766ef666ef2daa8c467e478183a957'
* commit 'ccbb31c14b766ef666ef2daa8c467e478183a957':
qsv: Make sure the session is set with the latest version
Merged-by: James Almer <jamrial@gmail.com>
-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 f1d16d8bf9..8e43420e70 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: " |