@@ -289,22 +289,7 @@ void Transcoder::process( IProgress& progress )
289
289
290
290
_outputFile.beginWrap ();
291
291
292
- double totalDuration = std::numeric_limits<double >::max ();
293
- switch ( _eProcessMethod )
294
- {
295
- case eProcessMethodShortest :
296
- totalDuration = getMinTotalDuration ();
297
- break ;
298
- case eProcessMethodLongest :
299
- totalDuration = getMaxTotalDuration ();
300
- break ;
301
- case eProcessMethodBasedOnStream :
302
- totalDuration = getStreamDuration ( _mainStreamIndex );
303
- break ;
304
- case eProcessMethodInfinity :
305
- totalDuration = std::numeric_limits<double >::max ();
306
- break ;
307
- }
292
+ double totalDuration = getTotalDurationFromProcessMethod ();
308
293
309
294
if ( _verbose )
310
295
av_log_set_level ( AV_LOG_DEBUG );
@@ -529,4 +514,19 @@ double Transcoder::getMaxTotalDuration() const
529
514
return maxTotalDuration;
530
515
}
531
516
517
+ double Transcoder::getTotalDurationFromProcessMethod () const
518
+ {
519
+ switch ( _eProcessMethod )
520
+ {
521
+ case eProcessMethodShortest :
522
+ return getMinTotalDuration ();
523
+ case eProcessMethodLongest :
524
+ return getMaxTotalDuration ();
525
+ case eProcessMethodBasedOnStream :
526
+ return getStreamDuration ( _mainStreamIndex );
527
+ case eProcessMethodInfinity :
528
+ return std::numeric_limits<double >::max ();
529
+ }
530
+ }
531
+
532
532
}
0 commit comments