提交 a39cde9d 编写于 作者: J jp9000

obs-qsv11: Fix win7 crash when fake monitor isn't forced

When using QSV is used on a windows 7 machine with a dedicated card, you
have to fake a monitor connection to your Intel graphics to be able to
use QSV.  If you do not, the initialization will fail with an error.
The error for that situation is not handled properly, and a variable
will be used while null.  Instead, the function should safely return
after that error is received.

Also, do not call ClearData in the destructor unless QSV has been
properly initialized (if m_pmfxENC is null).
上级 43eba49a
......@@ -126,7 +126,8 @@ QSV_Encoder_Internal::QSV_Encoder_Internal(mfxIMPL& impl, mfxVersion& version) :
QSV_Encoder_Internal::~QSV_Encoder_Internal()
{
ClearData();
if (m_pmfxENC)
ClearData();
}
mfxStatus QSV_Encoder_Internal::Open(qsv_param_t * pParams)
......@@ -140,8 +141,9 @@ mfxStatus QSV_Encoder_Internal::Open(qsv_param_t * pParams)
// Use system memory
sts = Initialize(m_impl, m_ver, &m_session, NULL);
if (sts == MFX_ERR_NONE)
m_pmfxENC = new MFXVideoENCODE(m_session);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
m_pmfxENC = new MFXVideoENCODE(m_session);
InitParams(pParams);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册