Skip to content

Commit 2e0fde3

Browse files
committed
Fix: video filters support and audio filters memory leak
Free video filters data at each process loop, but skip audio filters data frame. Improvement of be100b8 fix
1 parent af4c609 commit 2e0fde3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,12 +751,6 @@ IOutputStream::EWrappingStatus StreamTranscoder::processTranscode()
751751
_transformedData->allocateData();
752752
}
753753
}
754-
else if(_filterGraph->hasFilters())
755-
{
756-
LOG_DEBUG("Free filtered data") // filled from filter graph sink
757-
av_frame_unref(&_filteredData->getAVFrame());
758-
_filteredData->freeData();
759-
}
760754

761755
// Check decoding status
762756
bool continueProcess = true;
@@ -811,6 +805,15 @@ IOutputStream::EWrappingStatus StreamTranscoder::processTranscode()
811805
LOG_DEBUG("Encode")
812806
_outputEncoder->encodeFrame(*_transformedData, data);
813807

808+
if(_filterGraph->hasFilters())
809+
{
810+
LOG_DEBUG("Free filtered data") // filled from filter graph sink
811+
if (_filteredData->isVideoFrame()) {
812+
// Do not unref filter audio frame, to avoid reallocating it each time
813+
av_frame_unref(&_filteredData->getAVFrame());
814+
}
815+
_filteredData->freeData();
816+
}
814817
}
815818
else
816819
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy