]> granicus.if.org Git - handbrake/commitdiff
I can't explain this (nor have time to debug it).
authorTim Walker <tdskywalker@gmail.com>
Sun, 11 Sep 2016 01:45:07 +0000 (03:45 +0200)
committerTim Walker <tdskywalker@gmail.com>
Sun, 11 Sep 2016 01:45:07 +0000 (03:45 +0200)
libhb/decavcodec.c

index 7951ad05459dbf6ae7a995dc53c8691aabe4cd04..5f3dce01d80bbfe8ff238d7cea208020331cb9ef 100644 (file)
@@ -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);