Skip to content

Commit 93ce328

Browse files
author
Clement Champetier
committed
StreamTranscoder: fix memory leak in case of generator after a demultiplexing
In case of audio demultiplexing, we allocate the data buffer, so we should not reallocate it when we switch to a generator.
1 parent b6dc069 commit 93ce328

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,10 @@ bool StreamTranscoder::processTranscode()
599599
switchToGeneratorDecoder();
600600
LOG_INFO("Force reallocation of the decoded data buffers since the decoders could have cleared them.")
601601
for(std::vector<IFrame*>::iterator it = _decodedData.begin(); it != _decodedData.end(); ++it)
602-
(*it)->allocateData();
602+
{
603+
if(! (*it)->isDataAllocated())
604+
(*it)->allocateData();
605+
}
603606
return processTranscode();
604607
}
605608
return false;

0 commit comments

Comments
 (0)