Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8f5fe1

Browse files
author
Valentin NOEL
committed
StreamTranscoder: fix filter graph memory usage
1 parent36e222f commitc8f5fe1

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

‎src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,10 @@ StreamTranscoder::~StreamTranscoder()
435435
{
436436
delete(*it);
437437
}
438-
delete _filteredData;
438+
439+
if(_filteredData !=NULL && _filteredData->isDataAllocated())
440+
delete _filteredData;
441+
439442
delete _transformedData;
440443

441444
for(std::vector<IDecoder*>::iterator it = _inputDecoders.begin(); it != _inputDecoders.end(); ++it)
@@ -620,13 +623,17 @@ bool StreamTranscoder::processTranscode()
620623
constint nbInputSamplesPerChannel = _decodedData.at(_firstInputStreamIndex)->getAVFrame().nb_samples;
621624

622625
// Reallocate output frame
623-
if(nbInputSamplesPerChannel > _filteredData->getAVFrame().nb_samples)
626+
if(_filterGraph->hasFilters())
624627
{
625-
LOG_WARN("The buffer of filtered data corresponds to a frame of" << _filteredData->getAVFrame().nb_samples <<" samples. The decoded buffer contains" << nbInputSamplesPerChannel <<" samples. Reallocate it.")
626628
_filteredData->freeData();
627-
_filteredData->getAVFrame().nb_samples = nbInputSamplesPerChannel;
628-
_filteredData->allocateData();
629+
if(nbInputSamplesPerChannel > _filteredData->getAVFrame().nb_samples)
630+
{
631+
LOG_WARN("The buffer of filtered data corresponds to a frame of" << _filteredData->getAVFrame().nb_samples <<" samples. The decoded buffer contains" << nbInputSamplesPerChannel <<" samples. Reallocate it.")
632+
_filteredData->getAVFrame().nb_samples = nbInputSamplesPerChannel;
633+
_filteredData->allocateData();
634+
}
629635
}
636+
630637
if(nbInputSamplesPerChannel > _transformedData->getAVFrame().nb_samples)
631638
{
632639
LOG_WARN("The buffer of transformed data corresponds to a frame of" << _transformedData->getAVFrame().nb_samples <<" samples. The decoded buffer contains" << nbInputSamplesPerChannel <<" samples. Reallocate it.")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp