From c8f5fe1f6a178169b2e9100906ef95a226bb2c04 Mon Sep 17 00:00:00 2001 From: Valentin NOEL Date: Tue, 12 Dec 2017 11:39:15 +0100 Subject: [PATCH 1/2] StreamTranscoder: fix filter graph memory usage --- .../transcoder/StreamTranscoder.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/AvTranscoder/transcoder/StreamTranscoder.cpp b/src/AvTranscoder/transcoder/StreamTranscoder.cpp index 391f5ddd..78253644 100644 --- a/src/AvTranscoder/transcoder/StreamTranscoder.cpp +++ b/src/AvTranscoder/transcoder/StreamTranscoder.cpp @@ -435,7 +435,10 @@ StreamTranscoder::~StreamTranscoder() { delete(*it); } - delete _filteredData; + + if(_filteredData != NULL && _filteredData->isDataAllocated()) + delete _filteredData; + delete _transformedData; for(std::vector::iterator it = _inputDecoders.begin(); it != _inputDecoders.end(); ++it) @@ -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.") From 30b738541a43ad7f4087f23e5ce08ce1ab012216 Mon Sep 17 00:00:00 2001 From: Valentin NOEL Date: Tue, 12 Dec 2017 12:01:49 +0100 Subject: [PATCH 2/2] Update version to 0.14.1 --- src/AvTranscoder/common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvTranscoder/common.hpp b/src/AvTranscoder/common.hpp index 481daad0..33d87e37 100644 --- a/src/AvTranscoder/common.hpp +++ b/src/AvTranscoder/common.hpp @@ -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 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