@@ -47,7 +47,7 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
47
47
// Transcode
48
48
else
49
49
{
50
- ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
50
+ const ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
51
51
add ( filename, streamIndex, transcodeProfile, offset );
52
52
}
53
53
}
@@ -66,12 +66,12 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
66
66
// Transcode
67
67
else
68
68
{
69
- ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
69
+ const ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
70
70
add ( filename, streamIndex, transcodeProfile, codec, offset );
71
71
}
72
72
}
73
73
74
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, ProfileLoader::Profile& profile, const double offset )
74
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const ProfileLoader::Profile& profile, const double offset )
75
75
{
76
76
// Check filename
77
77
if ( ! filename.length () )
@@ -80,7 +80,7 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, Pro
80
80
addTranscodeStream ( filename, streamIndex, -1 , profile, offset );
81
81
}
82
82
83
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, ProfileLoader::Profile& profile, ICodec& codec, const double offset )
83
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const ProfileLoader::Profile& profile, ICodec& codec, const double offset )
84
84
{
85
85
// Generator
86
86
if ( ! filename.length () )
@@ -119,7 +119,7 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
119
119
// Transcode
120
120
else
121
121
{
122
- ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
122
+ const ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
123
123
add ( filename, streamIndex, subStreamIndex, transcodeProfile, offset );
124
124
}
125
125
}
@@ -150,12 +150,12 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
150
150
// Transcode
151
151
else
152
152
{
153
- ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
153
+ const ProfileLoader::Profile& transcodeProfile = _profileLoader.getProfile ( profileName );
154
154
add ( filename, streamIndex, subStreamIndex, transcodeProfile, codec, offset );
155
155
}
156
156
}
157
157
158
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, ProfileLoader::Profile& profile, const double offset )
158
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const ProfileLoader::Profile& profile, const double offset )
159
159
{
160
160
// No subStream selected
161
161
if ( subStreamIndex < 0 )
@@ -171,7 +171,7 @@ void Transcoder::add( const std::string& filename, const size_t streamIndex, con
171
171
addTranscodeStream ( filename, streamIndex, subStreamIndex, profile, offset );
172
172
}
173
173
174
- void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, ProfileLoader::Profile& profile, ICodec& codec, const double offset )
174
+ void Transcoder::add ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const ProfileLoader::Profile& profile, ICodec& codec, const double offset )
175
175
{
176
176
// No subStream selected
177
177
if ( subStreamIndex < 0 )
@@ -290,17 +290,18 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
290
290
ProfileLoader::Profile profile = getProfileFromFile ( *referenceFile, streamIndex );
291
291
292
292
// override channels parameter to manage demultiplexing
293
- ProfileLoader::Profile::iterator it = profile.find ( constants::avProfileChannel );
293
+ ProfileLoader::Profile::iterator it = profile.find ( constants::avProfileChannel );
294
294
if ( it != profile.end () )
295
295
it->second = " 1" ;
296
296
297
297
addTranscodeStream ( filename, streamIndex, subStreamIndex, profile, offset );
298
298
}
299
299
300
- void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, ProfileLoader::Profile& profile, const double offset )
300
+ void Transcoder::addTranscodeStream ( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const ProfileLoader::Profile& profile, const double offset )
301
301
{
302
302
// Add profile
303
- _profileLoader.loadProfile ( profile );
303
+ if ( ! _profileLoader.hasProfile ( profile ) )
304
+ _profileLoader.loadProfile ( profile );
304
305
305
306
LOG_INFO ( " Add transcode stream from file '" << filename << " ' / index=" << streamIndex << " / channel=" << subStreamIndex << " / encodingProfile=" << profile.at ( constants::avProfileIdentificatorHuman ) << " / offset=" << offset << " s" )
306
307
@@ -329,7 +330,8 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
329
330
void Transcoder::addDummyStream ( const ProfileLoader::Profile& profile, const ICodec& codec )
330
331
{
331
332
// Add profile
332
- _profileLoader.loadProfile ( profile );
333
+ if ( ! _profileLoader.hasProfile ( profile ) )
334
+ _profileLoader.loadProfile ( profile );
333
335
334
336
LOG_INFO ( " Add generated stream with codec '" << codec.getCodecName () << " ' / encodingProfile=" << profile.at ( constants::avProfileIdentificatorHuman ) )
335
337
0 commit comments