Skip to content

Fix filter graph memory usage #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AvTranscoder/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#define AVTRANSCODER_VERSION_MAJOR 0
#define AVTRANSCODER_VERSION_MINOR 14
#define AVTRANSCODER_VERSION_MICRO 0
#define AVTRANSCODER_VERSION_MICRO 1

#include <AvTranscoder/system.hpp>

Expand Down
17 changes: 12 additions & 5 deletions src/AvTranscoder/transcoder/StreamTranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ StreamTranscoder::~StreamTranscoder()
{
delete(*it);
}
delete _filteredData;

if(_filteredData != NULL && _filteredData->isDataAllocated())
delete _filteredData;

delete _transformedData;

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

// Reallocate output frame
if(nbInputSamplesPerChannel > _filteredData->getAVFrame().nb_samples)
if(_filterGraph->hasFilters())
{
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.")
_filteredData->freeData();
_filteredData->getAVFrame().nb_samples = nbInputSamplesPerChannel;
_filteredData->allocateData();
if(nbInputSamplesPerChannel > _filteredData->getAVFrame().nb_samples)
{
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.")
_filteredData->getAVFrame().nb_samples = nbInputSamplesPerChannel;
_filteredData->allocateData();
}
}

if(nbInputSamplesPerChannel > _transformedData->getAVFrame().nb_samples)
{
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.")
Expand Down
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