Skip to content

Commit d830180

Browse files
author
Clement Champetier
committed
Transcoder: load profile only if not already in ProfileLoader
1 parent 4747e4a commit d830180

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
300300
void Transcoder::addTranscodeStream( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const ProfileLoader::Profile& profile, const double offset )
301301
{
302302
// Add profile
303-
_profileLoader.loadProfile( profile );
303+
if( ! _profileLoader.hasProfile( profile ) )
304+
_profileLoader.loadProfile( profile );
304305

305306
LOG_INFO( "Add transcode stream from file '" << filename << "' / index=" << streamIndex << " / channel=" << subStreamIndex << " / encodingProfile=" << profile.at( constants::avProfileIdentificatorHuman ) << " / offset=" << offset << "s" )
306307

@@ -329,7 +330,8 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
329330
void Transcoder::addDummyStream( const ProfileLoader::Profile& profile, const ICodec& codec )
330331
{
331332
// Add profile
332-
_profileLoader.loadProfile( profile );
333+
if( ! _profileLoader.hasProfile( profile ) )
334+
_profileLoader.loadProfile( profile );
333335

334336
LOG_INFO( "Add generated stream with codec '" << codec.getCodecName() << "' / encodingProfile=" << profile.at( constants::avProfileIdentificatorHuman ) )
335337

0 commit comments

Comments
 (0)