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

Commit1c318c2

Browse files
authored
Merge pull request#305 from valnoel/fix_filtering_memory_usage
Fix filter graph memory usage
2 parents36e222f +30b7385 commit1c318c2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎src/AvTranscoder/common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#defineAVTRANSCODER_VERSION_MAJOR0
55
#defineAVTRANSCODER_VERSION_MINOR14
6-
#defineAVTRANSCODER_VERSION_MICRO0
6+
#defineAVTRANSCODER_VERSION_MICRO1
77

88
#include<AvTranscoder/system.hpp>
99

‎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