Fixed bugs when freeing the AVCodecEncoder.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-08-05 10:40:06 +00:00
parent eb4b63e744
commit b9b5bf07db
@@ -54,6 +54,16 @@ AVCodecEncoder::AVCodecEncoder(uint32 codecID, int bitRateScale)
av_fifo_init(&fAudioFifo, 0);
fDstFrame.data[0] = NULL;
fDstFrame.data[1] = NULL;
fDstFrame.data[2] = NULL;
fDstFrame.data[3] = NULL;
fDstFrame.linesize[0] = 0;
fDstFrame.linesize[1] = 0;
fDstFrame.linesize[2] = 0;
fDstFrame.linesize[3] = 0;
// Initial parameters, so we know if the user changed them
fEncodeParameters.avg_field_size = 0;
fEncodeParameters.max_field_size = 0;
@@ -67,7 +77,8 @@ AVCodecEncoder::~AVCodecEncoder()
_CloseCodecIfNeeded();
sws_freeContext(fSwsContext);
if (fSwsContext != NULL)
sws_freeContext(fSwsContext);
av_fifo_free(&fAudioFifo);