From: Tim Walker Date: Sun, 11 Sep 2016 01:45:07 +0000 (+0200) Subject: qsv: Update condition under which context is closed. X-Git-Tag: 1.0.0~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bece9c2677e20649e5ebf9d91cb7b55c8a7759db;p=handbrake qsv: Update condition under which context is closed. --- 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);