Skip to content

Commit dd89b56

Browse files
author
Valentin NOEL
committed
StreamTranscoder: manage process case according to the input index
1 parent 55a4bab commit dd89b56

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ bool StreamTranscoder::processTranscode()
604604
std::vector<bool> decodingStatus(_generators.size(), true);
605605
for(size_t index = 0; index < _generators.size(); ++index)
606606
{
607-
if(getProcessCase() == eProcessCaseTranscode)
607+
EProcessCase processCase = getProcessCase(index);
608+
if(processCase == eProcessCaseTranscode)
608609
_currentDecoder = _inputDecoders.at(index);
609610
else
610611
_currentDecoder = _generators.at(index);
@@ -795,13 +796,30 @@ void StreamTranscoder::setOffset(const float offset)
795796
}
796797
}
797798

798-
StreamTranscoder::EProcessCase StreamTranscoder::getProcessCase() const
799+
StreamTranscoder::EProcessCase StreamTranscoder::getProcessCase(const size_t decoderIndex) const
799800
{
800-
if(! _inputStreams.empty() && ! _inputDecoders.empty() && std::find(_inputDecoders.begin(), _inputDecoders.end(), _currentDecoder) != _inputDecoders.end() )
801-
return eProcessCaseTranscode;
802-
else if(! _inputStreams.empty() && _inputDecoders.empty() && !_currentDecoder)
803-
return eProcessCaseRewrap;
801+
if(_inputStreamDesc.size() <= 1)
802+
{
803+
if(! _inputStreams.empty() && ! _inputDecoders.empty() && std::find(_inputDecoders.begin(), _inputDecoders.end(), _currentDecoder) != _inputDecoders.end() )
804+
return eProcessCaseTranscode;
805+
else if(! _inputStreams.empty() && _inputDecoders.empty() && !_currentDecoder)
806+
return eProcessCaseRewrap;
807+
else
808+
return eProcessCaseGenerator;
809+
}
804810
else
811+
{
812+
if(! _inputStreams.empty() && _currentDecoder != NULL)
813+
{
814+
if( _inputStreams.at(decoderIndex) != NULL)
815+
return eProcessCaseTranscode;
816+
return eProcessCaseGenerator;
817+
}
818+
else if(! _inputStreams.empty() && _inputDecoders.empty() && !_currentDecoder)
819+
{
820+
return eProcessCaseRewrap;
821+
}
805822
return eProcessCaseGenerator;
823+
}
806824
}
807825
}

src/AvTranscoder/transcoder/StreamTranscoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class AvExport StreamTranscoder
115115
eProcessCaseRewrap,
116116
eProcessCaseGenerator
117117
};
118-
EProcessCase getProcessCase() const;
118+
EProcessCase getProcessCase(const size_t decoderIndex = 0) const;
119119
//@}
120120

121121
private:

0 commit comments

Comments
 (0)