summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorTim Walker <[email protected]>2016-09-11 03:45:07 +0200
committerJohn Stebbins <[email protected]>2016-12-17 07:28:51 -0800
commitbece9c2677e20649e5ebf9d91cb7b55c8a7759db (patch)
tree2e258d85d853bd5f0170d6ce654b22f30a891a47 /libhb/decavcodec.c
parentcf54e93d660a4f59b8a0bc3882b7726b8aebb84b (diff)
qsv: Update condition under which context is closed.
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 3ea4dbed4..57d3bba3a 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -350,9 +350,13 @@ static void closePrivData( hb_work_private_t ** ppv )
* MFXClose() on the QSV session. Even if decoding is complete, we
* still need that session for QSV filtering and/or encoding, so we
* we can't close the context here until we implement a proper fix.
+ *
+ * Interestingly, this may cause crashes even when QSV-accelerated
+ * decoding and encoding sessions are independent (e.g. decoding via
+ * libavcodec, but encoding using libhb, without us requesting any
+ * form of communication between the two libmfx sessions).
*/
- if (pv->qsv.decode == NULL ||
- pv->qsv.config.io_pattern != MFX_IOPATTERN_OUT_OPAQUE_MEMORY)
+ if (!(pv->qsv.decode && pv->job != NULL && (pv->job->vcodec & HB_VCODEC_QSV_MASK)))
#endif
{
hb_avcodec_close(pv->context);