From bece9c2677e20649e5ebf9d91cb7b55c8a7759db Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Sun, 11 Sep 2016 03:45:07 +0200 Subject: qsv: Update condition under which context is closed. --- libhb/decavcodec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libhb/decavcodec.c') 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); -- cgit v1.2.3