Skip to content

Commit bb2e0a2

Browse files
author
Clement Champetier
committed
Transcoder: fix subStreamIndex type of private addTranscodeStream functions
* subStreamIndex can be negative, and indicates that we will transcode all channels. * Log this info.
1 parent 7777579 commit bb2e0a2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void Transcoder::addRewrapStream( const std::string& filename, const size_t stre
290290
_streamTranscoders.push_back( _streamTranscodersAllocated.back() );
291291
}
292292

293-
void Transcoder::addTranscodeStream( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, const double offset )
293+
void Transcoder::addTranscodeStream( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const double offset )
294294
{
295295
// Get profile from input file
296296
InputFile* referenceFile = addInputFile( filename, streamIndex );
@@ -304,13 +304,17 @@ void Transcoder::addTranscodeStream( const std::string& filename, const size_t s
304304
addTranscodeStream( filename, streamIndex, subStreamIndex, profile, offset );
305305
}
306306

307-
void Transcoder::addTranscodeStream( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, ProfileLoader::Profile& profile, const double offset )
307+
void Transcoder::addTranscodeStream( const std::string& filename, const size_t streamIndex, const int subStreamIndex, ProfileLoader::Profile& profile, const double offset )
308308
{
309309
// Add profile
310310
_profileLoader.loadProfile( profile );
311311

312312
std::stringstream os;
313-
os << "Add transcode stream from file '" << filename << "' / index=" << streamIndex << " / channel=" << subStreamIndex;
313+
os << "Add transcode stream from file '" << filename << "' / index=" << streamIndex << " / channel=";
314+
if( subStreamIndex < 0 )
315+
os << "all";
316+
else
317+
os << subStreamIndex;
314318
os << " / encodingProfile=" << profile.at( constants::avProfileIdentificatorHuman ) << " / offset=" << offset << "s";
315319
Logger::info( os.str() );
316320

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ class AvExport Transcoder
134134
private:
135135
void addRewrapStream( const std::string& filename, const size_t streamIndex );
136136

137-
void addTranscodeStream( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, const double offset );
138-
void addTranscodeStream( const std::string& filename, const size_t streamIndex, const size_t subStreamIndex, ProfileLoader::Profile& profile, const double offset = 0 );
137+
void addTranscodeStream( const std::string& filename, const size_t streamIndex, const int subStreamIndex, const double offset );
138+
void addTranscodeStream( const std::string& filename, const size_t streamIndex, const int subStreamIndex, ProfileLoader::Profile& profile, const double offset = 0 );
139139

140140
void addDummyStream( const ProfileLoader::Profile& profile, const ICodec& codec );
141141

0 commit comments

Comments
 (0)