Improve buffering and fix memory leaks

Use a dedicated class to handle frame buffer
Fix memory leak in stream handler and frame allocation
This commit is contained in:
2017-09-22 00:54:46 +01:00
parent 58146a6b06
commit 1d07dd6b38
12 changed files with 159 additions and 160 deletions
+2
View File
@@ -389,6 +389,7 @@ Bool StreamHandlerLibav::read( PlaYUVerFrame* pcFrame )
#endif
pcFrame->frameFromBuffer( m_pStreamBuffer, m_iEndianness );
m_uiCurrFrameFileIdx++;
return true;
}
return false;
@@ -402,5 +403,6 @@ Bool StreamHandlerLibav::write( PlaYUVerFrame* pcFrame )
Bool StreamHandlerLibav::seek( UInt64 iFrameNum )
{
av_seek_frame( m_cFmtCtx, m_iStreamIdx, iFrameNum, AVSEEK_FLAG_FRAME );
m_uiCurrFrameFileIdx = iFrameNum;
return true;
}