File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -151,20 +151,26 @@ bool AudioDecoder::decodeNextFrame()
151
151
152
152
void AudioDecoder::setProfile ( const ProfileLoader::Profile& profile )
153
153
{
154
- // set threads if not in profile
155
- if ( ! profile.count ( " threads" ) )
156
- _inputStream->getAudioCodec ().getOption ( " threads" ).setString ( " auto" );
154
+ AudioCodec& codec = _inputStream->getAudioCodec ();
157
155
156
+ // set threads before any other options
157
+ if ( profile.count ( constants::avProfileThreads ) )
158
+ codec.getOption ( constants::avProfileThreads ).setString ( profile.at ( constants::avProfileThreads ) );
159
+ else
160
+ codec.getOption ( constants::avProfileThreads ).setString ( " auto" );
161
+
162
+ // set decoder options
158
163
for ( ProfileLoader::Profile::const_iterator it = profile.begin (); it != profile.end (); ++it )
159
164
{
160
165
if ( (*it).first == constants::avProfileIdentificator ||
161
166
(*it).first == constants::avProfileIdentificatorHuman ||
162
- (*it).first == constants::avProfileType )
167
+ (*it).first == constants::avProfileType ||
168
+ (*it).first == constants::avProfileThreads )
163
169
continue ;
164
170
165
171
try
166
172
{
167
- Option& decodeOption = _inputStream-> getAudioCodec () .getOption ( (*it).first );
173
+ Option& decodeOption = codec .getOption ( (*it).first );
168
174
decodeOption.setString ( (*it).second );
169
175
}
170
176
catch ( std::exception& e )
Original file line number Diff line number Diff line change @@ -110,20 +110,26 @@ void VideoDecoder::flushDecoder()
110
110
111
111
void VideoDecoder::setProfile ( const ProfileLoader::Profile& profile )
112
112
{
113
- // set threads if not in profile
114
- if ( ! profile.count ( " threads" ) )
115
- _inputStream->getVideoCodec ().getOption ( " threads" ).setString ( " auto" );
113
+ VideoCodec& codec = _inputStream->getVideoCodec ();
116
114
115
+ // set threads before any other options
116
+ if ( profile.count ( constants::avProfileThreads ) )
117
+ codec.getOption ( constants::avProfileThreads ).setString ( profile.at ( constants::avProfileThreads ) );
118
+ else
119
+ codec.getOption ( constants::avProfileThreads ).setString ( " auto" );
120
+
121
+ // set decoder options
117
122
for ( ProfileLoader::Profile::const_iterator it = profile.begin (); it != profile.end (); ++it )
118
123
{
119
124
if ( (*it).first == constants::avProfileIdentificator ||
120
125
(*it).first == constants::avProfileIdentificatorHuman ||
121
- (*it).first == constants::avProfileType )
126
+ (*it).first == constants::avProfileType ||
127
+ (*it).first == constants::avProfileThreads )
122
128
continue ;
123
129
124
130
try
125
131
{
126
- Option& decodeOption = _inputStream-> getVideoCodec () .getOption ( (*it).first );
132
+ Option& decodeOption = codec .getOption ( (*it).first );
127
133
decodeOption.setString ( (*it).second );
128
134
}
129
135
catch ( std::exception& e )
You can’t perform that action at this time.
0 commit comments