@@ -604,7 +604,8 @@ bool StreamTranscoder::processTranscode()
604
604
std::vector<bool > decodingStatus (_generators.size (), true );
605
605
for (size_t index = 0 ; index < _generators.size (); ++index)
606
606
{
607
- if (getProcessCase () == eProcessCaseTranscode)
607
+ EProcessCase processCase = getProcessCase (index);
608
+ if (processCase == eProcessCaseTranscode)
608
609
_currentDecoder = _inputDecoders.at (index);
609
610
else
610
611
_currentDecoder = _generators.at (index);
@@ -795,13 +796,30 @@ void StreamTranscoder::setOffset(const float offset)
795
796
}
796
797
}
797
798
798
- StreamTranscoder::EProcessCase StreamTranscoder::getProcessCase () const
799
+ StreamTranscoder::EProcessCase StreamTranscoder::getProcessCase (const size_t decoderIndex ) const
799
800
{
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
+ }
804
810
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
+ }
805
822
return eProcessCaseGenerator;
823
+ }
806
824
}
807
825
}
0 commit comments