Skip to content

Commit 144b8fc

Browse files
author
Clement Champetier
committed
OutputVideo: setProfile - refactoring
1 parent 935c1de commit 144b8fc

File tree

1 file changed

+18
-30
lines changed

1 file changed

+18
-30
lines changed

src/AvTranscoder/EssenceStream/OutputVideo.cpp

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,22 @@ void OutputVideo::setProfile( Profile::ProfileDesc& desc, const avtranscoder::Im
202202
}
203203

204204
_videoDesc.setVideoCodec( desc[ Profile::avProfileCodec ] );
205+
205206
const size_t frameRate = std::strtoul( desc[ Profile::avProfileFrameRate ].c_str(), NULL, 0 );
206207
_videoDesc.setTimeBase( 1, frameRate );
208+
207209
_videoDesc.setImageParameters( imageDesc );
208210

209211
for( Profile::ProfileDesc::iterator it = desc.begin(); it != desc.end(); ++it )
210212
{
211-
if( (*it).first == Profile::avProfileIdentificator )
212-
continue;
213-
if( (*it).first == Profile::avProfileIdentificatorHuman )
214-
continue;
215-
if( (*it).first == Profile::avProfileType )
216-
continue;
217-
if( (*it).first == Profile::avProfileCodec )
218-
continue;
219-
if( (*it).first == Profile::avProfilePixelFormat )
220-
continue;
221-
if( (*it).first == Profile::avProfileWidth )
222-
continue;
223-
if( (*it).first == Profile::avProfileHeight )
224-
continue;
225-
if( (*it).first == Profile::avProfileFrameRate )
213+
if( (*it).first == Profile::avProfileIdentificator ||
214+
(*it).first == Profile::avProfileIdentificatorHuman ||
215+
(*it).first == Profile::avProfileType ||
216+
(*it).first == Profile::avProfileCodec ||
217+
(*it).first == Profile::avProfilePixelFormat ||
218+
(*it).first == Profile::avProfileWidth ||
219+
(*it).first == Profile::avProfileHeight ||
220+
(*it).first == Profile::avProfileFrameRate )
226221
continue;
227222

228223
try
@@ -239,21 +234,14 @@ void OutputVideo::setProfile( Profile::ProfileDesc& desc, const avtranscoder::Im
239234

240235
for( Profile::ProfileDesc::iterator it = desc.begin(); it != desc.end(); ++it )
241236
{
242-
if( (*it).first == Profile::avProfileIdentificator )
243-
continue;
244-
if( (*it).first == Profile::avProfileIdentificatorHuman )
245-
continue;
246-
if( (*it).first == Profile::avProfileType )
247-
continue;
248-
if( (*it).first == Profile::avProfileCodec )
249-
continue;
250-
if( (*it).first == Profile::avProfilePixelFormat )
251-
continue;
252-
if( (*it).first == Profile::avProfileWidth )
253-
continue;
254-
if( (*it).first == Profile::avProfileHeight )
255-
continue;
256-
if( (*it).first == Profile::avProfileFrameRate )
237+
if( (*it).first == Profile::avProfileIdentificator ||
238+
(*it).first == Profile::avProfileIdentificatorHuman ||
239+
(*it).first == Profile::avProfileType ||
240+
(*it).first == Profile::avProfileCodec ||
241+
(*it).first == Profile::avProfilePixelFormat ||
242+
(*it).first == Profile::avProfileWidth ||
243+
(*it).first == Profile::avProfileHeight ||
244+
(*it).first == Profile::avProfileFrameRate )
257245
continue;
258246

259247
try

0 commit comments

Comments
 (0)