From c82e37ec7252a571dbf20c5424aef3e645605036 Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Sun, 11 Sep 2016 03:45:07 +0200 Subject: [PATCH] I can't explain this (nor have time to debug it). --- libhb/decavcodec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 7951ad054..5f3dce01d 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -346,9 +346,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); -- 2.40.0