Skip to content

Commit 816e102

Browse files
author
Clement Champetier
committed
Video/AudioEncoder: set threads options to auto if no set by the user
1 parent 7bd3b50 commit 816e102

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/AvTranscoder/encoder/AudioEncoder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ void AudioEncoder::setProfile( const ProfileLoader::Profile& profile, const Audi
150150
// set sampleRate, number of channels, sample format
151151
_codec.setAudioParameters( frameDesc );
152152

153+
// set threads if not in profile
154+
if( ! profile.count( "threads" ) )
155+
_codec.getOption( "threads" ).setString( "auto" );
156+
153157
// set encoder options
154158
for( ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it )
155159
{

src/AvTranscoder/encoder/VideoEncoder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ void VideoEncoder::setProfile( const ProfileLoader::Profile& profile, const avtr
133133
// set width, height, pixel format, fps
134134
_codec.setImageParameters( frameDesc );
135135

136+
// set threads if not in profile
137+
if( ! profile.count( "threads" ) )
138+
_codec.getOption( "threads" ).setString( "auto" );
139+
136140
// set encoder options
137141
for( ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it )
138142
{

0 commit comments

Comments
 (0)