Clear m_sws_ctx when freeing it.

Oops.  May help #5781.
This commit is contained in:
Unknown W. Brackets 2014-04-01 21:24:38 -07:00
parent d83a5da6bd
commit 91323ebe92

View file

@ -313,8 +313,8 @@ void MediaEngine::closeContext()
m_pCodecCtxs.clear();
if (m_pFormatCtx)
avformat_close_input(&m_pFormatCtx);
if (m_sws_ctx != NULL)
sws_freeContext(m_sws_ctx);
sws_freeContext(m_sws_ctx);
m_sws_ctx = NULL;
m_pIOContext = 0;
#endif
m_buffer = 0;
@ -414,9 +414,7 @@ bool MediaEngine::setVideoDim(int width, int height)
// Allocate video frame
m_pFrame = av_frame_alloc();
if (m_sws_ctx != NULL) {
sws_freeContext(m_sws_ctx);
}
sws_freeContext(m_sws_ctx);
m_sws_ctx = NULL;
m_sws_fmt = -1;
updateSwsFormat(GE_CMODE_32BIT_ABGR8888);