Skip to content

Commit

Permalink
qsv: Update condition under which context is closed.
Browse files Browse the repository at this point in the history
  • Loading branch information
twalker314 authored and jstebbins committed Dec 17, 2016
1 parent cf54e93 commit bece9c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libhb/decavcodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bece9c2

Please sign in to comment.